更新用户信息接口
This commit is contained in:
parent
59d2f3a160
commit
d88eb168d4
|
@ -29,6 +29,10 @@ class HomeIndex extends ApiController
|
||||||
$uid = JWT_UID;
|
$uid = JWT_UID;
|
||||||
$userInfo = Db::name('Admin')->where(['id' => $uid])->field(['id', 'username', 'name', 'email', 'mobile', 'sex', 'nickname', 'thumb', 'did', 'position_id', 'desc', 'entry_time'])->find();
|
$userInfo = Db::name('Admin')->where(['id' => $uid])->field(['id', 'username', 'name', 'email', 'mobile', 'sex', 'nickname', 'thumb', 'did', 'position_id', 'desc', 'entry_time'])->find();
|
||||||
$userInfo['entry_time'] = date('Y-m-d', $userInfo['entry_time']);
|
$userInfo['entry_time'] = date('Y-m-d', $userInfo['entry_time']);
|
||||||
|
$department = Db::name('Department')->where('id', $userInfo['did'])->column('title', 'id');
|
||||||
|
$position = Db::name('Position')->where('id', $userInfo['position_id'])->column('title', 'id');
|
||||||
|
$userInfo['department_name'] = $department[$userInfo['did']] ?? '';
|
||||||
|
$userInfo['position_name'] = $position[$userInfo['position_id']] ?? '';
|
||||||
$this->apiSuccess('获取成功', $userInfo);
|
$this->apiSuccess('获取成功', $userInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue