0
我正在寻找显示尚未过期的优惠券以及根本没有到期的优惠券。这里是我的CakePHP代码:Cakephp发现OR条件不起作用
public function coupons() {
$this->paginate['Coupon']=array(
'limit'=>9,
'order'=>'RAND()',
'OR'=>array(
'expires' =>0,
'Coupon.end_date >'=>date('Y-m-d')
)
);
$c=$this->paginate('Coupon');
$this->set('allcoupons', $c);
}
一切正常,除了那些已经过期的优惠券。他们仍然显示在我的结果。我有一个测试记录在今天之前到期,但它仍然显示在我的结果中。我的'OR'条件写错了吗?