You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my datatable, I'm retrieving the name field as CONCAT(fname," ", "lname"). I have to search name field in the datatable and it should return matching with either fname or lname. Please let me know how to do this:
js code:
columns : [
{ data: 'name', name: 'fname' }, //I have tried this also : ['fname','lname' ]
--------------------
PHP code:
$users = User::leftJoin('address', 'address.user_id', '=', 'users.user_id')
->select([\DB::Raw(
'CONCAT(fname," ",lname) as name, CONCAT(country_code, "", mobile_number) as mobile_num, IF(status = 1, "Active", "Inactive") as status,
(SELECT count(subscription_id) FROM subscription WHERE subscription.user_id = users.user_id AND subscription.status IN (2,4)) as totalActivesubscription'
), 'gender', 'city as address', 'city','users.user_id', 'email_id'])
->where('users.role_id', '=', $aParam['role_id']);
return Datatables::of($users)
->addColumn('actions', function ($users) {
return view('users.templates.user_action', [
'user' => $users
])->render();
})
->make(true);
System details:"
Operating System : Windows8, Linux
PHP Version : 5.6
Laravel Version : 5.3
Laravel-Datatables Version : latest
The text was updated successfully, but these errors were encountered:
Hi,
In my datatable, I'm retrieving the name field as CONCAT(fname," ", "lname"). I have to search name field in the datatable and it should return matching with either fname or lname. Please let me know how to do this:
js code:
PHP code:
System details:"
The text was updated successfully, but these errors were encountered: