symql
symql copied to clipboard
Where criteria gets overruled if there is a $query->where('system:id', 15);
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?
I think that 'system:id' eliminates all other filters :(