|
@@ -38,14 +38,12 @@ class LuticateGroupsDataAccess extends LuDataAccess {
|
38
|
38
|
}
|
39
|
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
|
|
- 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");
|
|
41
|
+ $model = LuticateUsers::where("luticate_users.username", "ilike", "%" . $query . "%")
|
|
42
|
+ ->where("luticate_users.email", "ilike", "%" . $query . "%", "or")
|
|
43
|
+ ->where("luticate_users.firstname", "ilike", "%" . $query . "%", "or")
|
|
44
|
+ ->where("luticate_users.lastname", "ilike", "%" . $query . "%", "or")
|
|
45
|
+ ->where("luticate_users_groups.group_id", "=", $group_id, "and")
|
|
46
|
+ ->join("luticate_users_groups", "luticate_users.id", "=", "luticate_users_groups.user_id");
|
49
|
47
|
|
50
|
48
|
$count = $model->count();
|
51
|
49
|
|