微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

php – Yii2:findone()语法在多个where条件

我有一个表ipd_charges列

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]);

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐