How can I put in GC the following where statement:
status = ‘Active’ or status is null?
How can I put in GC the following where statement:
status = ‘Active’ or status is null?
Hello @GabrielD ,
Yes it is possible to have that. The trick here is to use the string as a value and the parenthesis. So more specifically for your example you should use:
$crud->where("(status='Active' OR status IS NULL)");
The parenthesis is very important or else you will have issues with the quick filters.
Hope it helped.
Regards
Johnny
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Using `unsetPagination()` but limit is still applied |
|
3 | 619 | Apr 12 |
| [RESOLVED] Updated Grocery CRUD Enterprise from 3.2.4 to 3.2.7 |
|
1 | 842 | Jan 14 |
| The “uniqueFields” function only throws an error in English |
|
0 | 847 | Jan 19 |
| Custom validation functions |
|
0 | 727 | Jan 22 |
| setRule - Validate doesn’t support more than 3 parameters |
|
0 | 603 | Feb 23 |