panlumeng 2 years ago
parent
commit
ebf5c986e7
1 changed files with 10 additions and 1 deletions
  1. 10 1
      app/admin/controller/User.php

+ 10 - 1
app/admin/controller/User.php

@@ -72,9 +72,18 @@ class User extends BaseController
         }
         $userinfo=GetUserInfo($token);
         if(empty($userinfo)||$userinfo['code']!=0){
+            return app_show(102,"员工信息不存在");
+        }
+        $id = isset($post['id']) && $post['id'] !==""? trim($post['id']):"";
+        if($id ==""){
+            return error_show(1004,"id不能为空");
+        }
+        $to= GetInfoById($token,['id'=>$id]);
+        if(empty($to)||$to['code']!=0){
             return app_show(1002,"员工信息不存在");
         }
-        $data = $userinfo['data'];
+       // $nickname = isset($to['data']['nickname']) &&$to['data']['nickname']!="" ? $to['data']['nickname'] :"" ;
+        $data = $to['data'];
         $role = Db::name("user_role")->alias('a')->leftJoin('role b',"a.roleid = b.id")->where("a.uid","=",$data['id'])
             ->field("roleid,role_name,business_all,uid")->find();
         $data['role_name']=isset($role['role_name']) ? $role['role_name'] :"";