table – ipd_charges
id doctor room_category charges_cash charges_cashless
1 1 1 200 300
2 1 2 300 400
表 – patient_admission
id patient_name tpa_name(if not null, equivalent to charges_cashless)
1 1 Null
2 2 1
table daily_ward_entry
id patient_name room_name doctor_name charges ( from ipd charges)
1 1 1 1 200
2 2 2 1 400
我试图使用这个失败的查询:
$model = \app\models\IpdCharges::find()
->where(['doctor'=>$id])
->andwhere(['room_category'=>$this->room_name])->one();
谢谢.如果需要更多信息,请告诉我.
非常感谢帮助.
解决方法:
请检查以下代码:
$ipdCharges = new IpdCharges();
$ipdCharges->findOne(['doctor' => $id, 'room_category' => $this->room_name]);