yingzi 2 năm trước cách đây
mục cha
commit
c225a63fc9
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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);