hasOne(Drug::class,['id'=>'drug_id']); } //关联仓库 public function getDrugStoreDrug() { return $this->hasOne(DrugStoreDrug::class,['drug_id'=>'drug_id']); } }