fixed error in search logic
This commit is contained in:
parent
0e51f1eb41
commit
1e24e8c787
|
|
@ -78,9 +78,14 @@ protected function setupListOperation()
|
|||
'type' => 'profile_name',
|
||||
'searchLogic' => function ($query, $column, $searchTerm) {
|
||||
$query->whereHas('profile', function ($q) use ($column, $searchTerm) {
|
||||
$q->where('name', 'like', '%'.$searchTerm.'%')
|
||||
->orWhere('surname', 'like', '%'.$searchTerm.'%')
|
||||
if($column->profile->type == "business"){
|
||||
$q->where('name', 'like', '%'.$searchTerm.'%')
|
||||
->orWhere('surname', 'like', '%'.$searchTerm.'%');
|
||||
}
|
||||
else{
|
||||
$q->where('name', 'like', '%'.$searchTerm.'%')
|
||||
->orWhere('short_name', 'like', '%'.$searchTerm.'%');
|
||||
}
|
||||
});
|
||||
}
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue