[英]Cake PHP => Combine conditions array and SQL statement
how can I combine a conditions array and a normal SQL statement? 如何结合条件数组和普通的SQL语句? My conditions array looks like the following one:
我的条件数组如下所示:
[conditions] => Array
(
[AND] => Array
(
[0] => Array
(
[Webdetail.kW1 LIKE] => %%
)
[1] => Array
(
[Webdetail.Upm1 LIKE] => %%
)
[2] => Array
(
[Webdetail.Volt1 LIKE] => %%
)
But in some cases I have to use a normal SQL statement for the Webdetail.Upm1 field, instead the LIKE. 但是在某些情况下,我必须对Webdetail.Upm1字段使用普通的SQL语句,而不是LIKE。 The SQL statement looks like: between 500*.9 and 500*1.1 and pol1=12
SQL语句看起来像:在500 * .9和500 * 1.1之间,并且pol1 = 12
Thank you, Nico 谢谢你尼科
将此添加到您的条件中:
'Webdetail.Upm1 BETWEEN ? AND ?' => array(500 * 0.9, 500 * 1.1)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.