Open zainabideengeeko opened 1 year ago
Help to get out of this issue.
I'm using individual column search, the filter column is not working with DB::raw.
These are the versions
"yajra/laravel-datatables": "9.0",
"yajra/laravel-datatables-oracle": "^10.0"
Afaik, having SQL count is not supported by the framework inside a nested where clause.
Workaround, include the having SQL on the query() method.
Afaik, having SQL count is not supported by the framework inside a nested where clause.
Workaround, include the having SQL on the query() method.
I'm facing problems with raw queries only. filter column is from datatable method and raw queries from the query method please note I'm using individual column searching
DB::raw("CASE WHEN bookings.payment_status = 1 THEN 'Paid' ELSE 'Unpaid' END AS payment_status")
->filterColumn('payment_status', function($query, $keyword) {
$keywords = trim($keyword);
$query->whereRaw("CASE WHEN bookings.payment_status = 1 THEN 'Paid' ELSE 'Unpaid' END LIKE ?", ["%{$keywords}%"]);
})
DB::raw("CONCAT(makes.title,' ',make_models.title) AS car"),
->filterColumn('car', function($query, $keyword) {
$keywords = trim($keyword);
$query->whereRaw("CONCAT(makes.title,' ',make_models.title) like ?", ["%{$keywords}%"]);
})