20 lines
674 B
PHP
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]);
|
|
}
|
|
|
|
} |