|
@@ -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'] :"";
|