|
@@ -36,10 +36,16 @@ class LuticateGroupsDataAccess extends LuDataAccess {
|
36
|
36
|
return null;
|
37
|
37
|
return $group->toDbo();
|
38
|
38
|
}
|
39
|
|
- public static function getUsers($group_id, $page = 0, $perPage = PHP_INT_MAX)
|
|
39
|
+ public static function getUsers($group_id, $page = 0, $perPage = PHP_INT_MAX, $query = "")
|
40
|
40
|
{
|
41
|
|
- $model = LuticateUsers::where("luticate_users_groups.group_id", "=", $group_id)
|
42
|
|
- ->join("luticate_users_groups", "luticate_users.id", "=", "luticate_users_groups.user_id");
|
|
41
|
+ $model = LuticateUsers::where("luticate_users_groups.group_id", "=", $group_id);
|
|
42
|
+ if (!is_null($query) && $query != "") {
|
|
43
|
+ $model->where("luticate_users.username", "ilike", "%" . $query . "%")
|
|
44
|
+ ->where("luticate_users.email", "ilike", "%" . $query . "%")
|
|
45
|
+ ->where("luticate_users.firstname", "ilike", "%" . $query . "%")
|
|
46
|
+ ->where("luticate_users.lastname", "ilike", "%" . $query . "%");
|
|
47
|
+ }
|
|
48
|
+ $model->join("luticate_users_groups", "luticate_users.id", "=", "luticate_users_groups.user_id");
|
43
|
49
|
|
44
|
50
|
$count = $model->count();
|
45
|
51
|
|