5.0.0 - 严重 - 已关闭
不作绑定可以正常运行:
$rs = Db::query('select * from station_news where (time > 0) and ( ((send_id = 888888) and ((type = 1 and rec_id = 123456) or (type = 2 and rec_id in (222,555)))) or ((send_id = 123456) and ((type = 1 and rec_id = 888888) or (type = 2 and rec_id in (0)))) ) order by time asc');
使用占位报错:
$rs = Db::query('select * from station_news where (time > ?) and ( ((send_id = ?) and ((type = 1 and rec_id = ?) or (type = 2 and rec_id in ?))) or ((send_id = ?) and ((type = 1 and rec_id = ?) or (type = 2 and rec_id in ?))) ) order by time asc',[0,888888, 123456,[222,555], 123456,888888,0]);
$rs = Db::query('select * from station_news where (time > :time) and ( ((send_id = :send_id_0) and ((type = 1 and rec_id = :rec_id_0) or (type = 2 and rec_id in :user_group_0))) or ((send_id = :send_id_1) and ((type = 1 and rec_id = :rec_id_1) or (type = 2 and rec_id in :user_group_1))) ) order by time asc',['time' => 0,'send_id_0' => 888888, 'rec_id_0' => 123456,'user_group_0' => [222,555],'send_id_1' => 123456,'rec_id_1' => 888888,'user_group_1' => 0]);
还有绑定参数的数据,数组只有一个元素也会报错! 