瀏覽代碼

2018-01-08 User

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); //????
     }
 
     /**