Files
xk-api-yii/common/models/oldDb/DoctorCommon.php

20 lines
686 B
PHP

<?php
namespace common\models\oldDb;
class DoctorCommon extends \common\modelsgii\oldDb\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]);
}
}