Files
xk-api-yii/common/models/DrugStoreRelations.php
2024-11-05 13:26:58 +08:00

30 lines
559 B
PHP

<?php
namespace common\models;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
class DrugStoreRelations extends \common\modelsgii\DrugStoreRelations
{
//关联基本药品信息
public function getDrug()
{
return $this->hasOne(Drug::class,['id'=>'drug_id']);
}
//关联仓库
public function getDrugStoreDrug()
{
return $this->hasOne(DrugStoreDrug::class,['drug_id'=>'drug_id']);
}
public function getStore()
{
return $this->hasOne(Store::class,['id' => 'store_id']);
}
}