songxingwei 2 years ago
parent
commit
e0493dc316

+ 2 - 2
app/data/controller/api/auth/Center.php

@@ -52,8 +52,8 @@ class Center extends Auth
     public function get()
     {
         $user = $this->getUser();
-        $pooltalent = DataPoolTalent::mk()->where('uuid',$this->uuid)->find();
-        $user['pooltalent'] = $pooltalent;
+//        $pooltalent = DataPoolTalent::mk()->where('uuid',$this->uuid)->find();
+//        $user['pooltalent'] = $pooltalent;
         $maintenance = DataMaintenance::mk()->where('uuid',$this->uuid)->find();
         $user['maintenance'] = $maintenance;
         $shipyard = DataShipyard::mk()->where('uuid',$this->uuid)->find();

+ 1 - 0
app/data/model/DataUser.php

@@ -34,4 +34,5 @@ class DataUser extends Model
     public function pooltalent(){
         return $this->hasOne(DataPoolTalent::class,'uuid');
     }
+    
 }

+ 4 - 1
app/data/service/UserAdminService.php

@@ -83,7 +83,10 @@ class UserAdminService extends Service
     public static function get(int $uuid, string $type)
     {
         $map = ['id' => $uuid, 'deleted' => 0];
-        $user = DataUser::mk()->where($map)->findOrEmpty();
+        $user = DataUser::mk()
+            ->where($map)
+            ->with(['pooltalent'])
+            ->findOrEmpty();
         if ($user->isEmpty()) throw new Exception('用户还没有注册!');
         // 用户认证令牌处理
         $map = ['uuid' => $uuid, 'type' => $type];