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

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...