| xqd
@@ -50,9 +50,15 @@ class UserController extends Controller
|
|
|
/**
|
|
|
* 获取用户详情
|
|
|
*/
|
|
|
- public function show()
|
|
|
+ public function show(Request $request)
|
|
|
{
|
|
|
- $info = User::query()->where('id',$this->userId)->first();
|
|
|
+ $id = $request->get('id');
|
|
|
+ if(!empty($id)){
|
|
|
+ $id = $id;
|
|
|
+ }else{
|
|
|
+ $id = $this->userId;
|
|
|
+ }
|
|
|
+ $info = User::query()->where('id',$id)->first();
|
|
|
// 会员是否到期
|
|
|
if($info && !empty($info['end_time'])){
|
|
|
if(time() > strtotime($info['end_time'])){
|
| xqd
@@ -61,7 +67,7 @@ class UserController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $info->follow_count = UserFollow::query()->where('user_id',$this->userId)->count();
|
|
|
+ $info->follow_count = UserFollow::query()->where('user_id',$id)->count();
|
|
|
return $this->success($info);
|
|
|
}
|
|
|
/**
|