Or_where clause won't auto refresh anymore because of the or_where clause
Or_where clause won't auto refresh anymore because of the or_where clause
YoDavish
Posts: 123Questions: 46Answers: 3
Hello i have an or_where clause below that stops datatables editor from refresh after an edit has been made. Below is the code in quesiton. If i comment out the $q->or_where it will auto refresh.
->where( function ($q){
$q->where(function ( $s ) {
$s->where('Completed', 0);
$s->where( "ifnull(inactiveflag,'')", '');
});
$q->or_where( function ( $r ) {
$r->where('Completed', 1);
$r->where('cmbt_modified_date', 'DATE_ADD( NOW(), INTERVAL -1 DAY )', '>', false);
});
This question has an accepted answers - jump to answer
Answers
You need to nest it one more level. The
Editor->where()
method doesn't automatically include parenthesis, but theQuery->where()
method does!This should do it:
Allan