Files
xk-api-yii/common/models/DoctorCommon.php
2024-09-19 11:32:39 +08:00

20 lines
674 B
PHP

<?php
namespace common\models;
class DoctorCommon extends \common\modelsgii\DoctorCommon
{
public function getDrug()
{
return $this->hasOne(Drug::class,['id'=>'drug_id'])->select('id,drug_name,source,type,info,content,usage,function,specification,image,instruction');
}
public function getDrugStoreDrug(){
return $this->hasOne(DrugStoreDrug::class,['drug_id'=>'drug_id'])->andWhere(['yii_drugstore_drug.status' => 2]);
}
public function getDrugStoreRelation()
{
return $this->hasOne(DrugStoreRelations::class,['drug_id'=>'drug_id', 'store_id'=>'store_id'])->andWhere(['yii_drug_store_relations.status' => 2]);
}
}