cakephp - MySQL query - 2 sets of conditions -
OK, I was thinking about it for a long time, and confused myself! I am trying to come up with a MySQL query in CakePHP for this scenario:
Each record has 2 dates; For simplicity I have to give them F & amp; I. These determine the quality of the data, as follows:
Bad data - F & amp; I have good data for both useless - F & amp;
The first two are very easy:
Red: P> green: But I have trouble with the third option. I have tried some things, and I know that there is something like this. : But obviously this will not work because the 'AND' Different rates I know that the solution is not so hard, but I could not get your head on your head! Can anyone help? Thanks! $ terms ['and'] = array ('f' = & gt; tap, 'i' = & gt; null);
$ terms ['and'] = array ('f '=' = & gt; three months ago, 'I >
$ terms ['no'] = array ('and' = & gt; array ('f '=' = & gt; three months ago, 'I & gt; = '= & Gt; three months ago),' AND '= & gt; array (' F '= & gt; null,' I '= & gt; null))
I think there is a problem in your bullion argument. If you want F & amp; For representing the dates within the last three months, then you are deciding any entry where F> = three months or i> = three months
This will be done on Dee Morgan's To be less confusing in using the law - no (F> = three months or I> = three months)
is the same as F < Three months and I & lt; Therefore, for the third rule, the essence of your positions will be:
array ('condition' = & gt; array ('AND' = & gt; array (' F & lt; '= & gt; three months,' i
Comments
Post a Comment