symql icon indicating copy to clipboard operation
symql copied to clipboard

Where criteria gets overruled if there is a $query->where('system:id', 15);

Open wdebusschere opened this issue 7 years ago • 1 comments

Usually you use the where criteria to select a record, but we would like to check if this record 15 has also a date equal to or later than today, so we don't need to check the resultdetail.

- Test 1 👍 ->where('system:id', 15); Result = 1 record

- Test 2 👍

->where('datum', 'start: equal to or later than today')
->where('active', 'yes')

Result = 25 Records

- Test 3 👍

->where('system:id', 15); 
->where('datum', 'start: equal to or later than today')
->where('active', 'yes') 

Result = 1 Records (with system:id 15)

- Test 4 👎

->where('system:id', 15); 
->where('datum', 'start: earlier than today')
->where('active', 'yes') 

Result = 1 Records (with system:id 15) Should be 0 Records

- Test 5 👎

->where('system:id', 15); 
->where('datum', 'start: equal to or later than today')
->where('active', 'no') 

Result = 1 Records (with system:id 15) Should be 0 Records

The SymQL::getDebug() doesn't show the system:id code so this must be on another level?

wdebusschere avatar Feb 21 '18 17:02 wdebusschere

I think that 'system:id' eliminates all other filters :(

nitriques avatar Feb 21 '18 19:02 nitriques