panlumeng 2 年之前
父節點
當前提交
ebf5c986e7
共有 1 個文件被更改,包括 10 次插入1 次删除
  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'] :"";