Yii Query Builder multiple where clauses
I noticed in my stack that my query wasn't being executed correctly as I
had multiple where clauses in my querybuilder. So I looked at this post
Multiple call where in Yii Query builder
Applied what i'd read, but still the query doesn't combine the where
statements. What am I doing wrong?
$command = Yii::app()->db->createCommand()
....
->where(array('in', 'u.id', $licenses), array('and', 'i.date_added
> DATE_SUB(u.date_expired, INTERVAL 30 DAY)'));
//->where(array('and', 'i.date_added > DATE_SUB(u.date_expired,
INTERVAL 30 DAY)'));
//->where(array('and', 'u.date_expired > CURDATE()'))
->group('u.id');
These were 3 individual statements, but I combined them as I read, but
still the same result. Only 1 where clause.
No comments:
Post a Comment