yingzi %!s(int64=2) %!d(string=hai) anos
pai
achega
c225a63fc9
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      app/api/middleware/UserMiddleware.php

+ 4 - 1
app/api/middleware/UserMiddleware.php

@@ -38,7 +38,10 @@ class UserMiddleware implements MiddlewareInterface
         }
         try{
             $memData = (new UserModel)
-                ->where('token',$token)
+                ->alias("u")
+                ->field("u.*,wt.title as user_work_type_title")
+                ->join("user_work_type_id wt","wt.id = u.user_work_type_id","left")
+                ->where('u.token',$token)
                 ->find();
             if(empty($memData)) {
                 throw new AuthException('用户不存在', 410000);