|
|
|
@ -168,4 +168,24 @@ class User extends BaseController |
|
|
|
'total' => $list->total() |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户信息 |
|
|
|
* @return array |
|
|
|
* @throws \think\db\exception\DataNotFoundException |
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
*/ |
|
|
|
public function userInfo() |
|
|
|
{ |
|
|
|
$userData = Session::get('login_user_data'); |
|
|
|
|
|
|
|
$UserModel = new UserModel(); |
|
|
|
|
|
|
|
$info = $UserModel->field('id,avatar,balance,withdrawal_balance')->where('id',$userData['id'])->find(); |
|
|
|
|
|
|
|
$info['avatar'] = get_image_url($info['avatar']); |
|
|
|
|
|
|
|
return $this->renderSuccess('数据返回成功',['data' => $info]); |
|
|
|
} |
|
|
|
} |