初始化仓库
This commit is contained in:
20
common/models/DoctorCommon.php
Normal file
20
common/models/DoctorCommon.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user