Visman 7 роки тому
батько
коміт
bf70d75ddc
2 змінених файлів з 4 додано та 6 видалено
  1. 2 4
      app/Models/User/Load.php
  2. 2 2
      app/Models/User/Model.php

+ 2 - 4
app/Models/User/Load.php

@@ -42,12 +42,10 @@ class Load extends Action
 
         // число найденных пользователей отлично от одного
         $count = count($data);
-        if ($count !== 1) {
+        if (1 !== $count || 1 === $data[0]['id']) {
             return $count;
         }
 
-        $user = $this->manager->create($data[0]);
-
-        return $user->isGuest ? 1 : $user;
+        return $this->manager->create($data[0]);
     }
 }

+ 2 - 2
app/Models/User/Model.php

@@ -27,8 +27,8 @@ class Model extends DataModel
     protected function getisGuest()
     {
         return $this->group_id == $this->c->GROUP_GUEST
-            || $this->id < 2
-            || empty($this->group_id);
+            || $this->id < 2 //????
+            || empty($this->group_id); //????
     }
 
     /**