SELECT * FROM `sdb_b2c_orders` WHERE
(pay_status='1' AND ship_status='0')
OR
(pay_status='0' AND payment='-1' AND ship_status='0')
Yii2的model 如果写出这样的过滤规则呢??
orWhere() andWhere()方法也无法在OR () 括号里面 像上面嵌套and
SELECT * FROM `sdb_b2c_orders` WHERE
(pay_status='1' AND ship_status='0')
OR
(pay_status='0' AND payment='-1' AND ship_status='0')
Yii2的model 如果写出这样的过滤规则呢??
orWhere() andWhere()方法也无法在OR () 括号里面 像上面嵌套and
$orders = Orders::find()->filterWhere([
'pay_status' => 1,
'ship_status' => 0
])->orFilterWhere([
'pay_status' => 0,
'payment' => 1,
'ship_status' => 0
])->all();
1 回答887 阅读
817 阅读