Przeglądaj źródła

test get all users not in group

tags/0.1.0
Robin Thoni 8 lat temu
rodzic
commit
8f105041b9
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6
    6
      src/Auth/DataAccess/LuticateGroupsDataAccess.php

+ 6
- 6
src/Auth/DataAccess/LuticateGroupsDataAccess.php Wyświetl plik

@@ -61,12 +61,12 @@ class LuticateGroupsDataAccess extends LuDataAccess {
61 61
 
62 62
     public static function getOtherUsers($group_id, $page = 0, $perPage = PHP_INT_MAX, $query = "")
63 63
     {
64
-        $model = LuticateUsers::/*where("luticate_users.username", "ilike", "%" . $query . "%")
65
-            ->where("luticate_users.email", "ilike", "%" . $query . "%", "or")
66
-            ->where("luticate_users.firstname", "ilike", "%" . $query . "%", "or")
67
-            ->where("luticate_users.lastname", "ilike", "%" . $query . "%", "or")
68
-            ->*/where("luticate_users_groups.group_id", "!=", $group_id, "and")
69
-            ->join("luticate_users_groups", "luticate_users.id", "=", "luticate_users_groups.user_id");
64
+        $model = LuticateUsers::where("luticate_users.id", "IS", "NULL")
65
+            ->leftJoin("luticate_users_groups", function($join) use ($group_id)
66
+            {
67
+                $join->on("luticate_users.id", "=", "luticate_users_groups.user_id")
68
+                ->on("luticate_users_groups.group_id", "=", $group_id);
69
+            });
70 70
 
71 71
         $count = $model->count();
72 72
 

Ładowanie…
Anuluj
Zapisz