...
|
...
|
@@ -26,6 +26,7 @@ class User extends BaseApi |
|
|
* @ApiTitle (会员中心)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/user/index)
|
|
|
* @ApiParams (name="user_id", type="integer", required=true, description="用户id")
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
|
...
|
...
|
@@ -61,8 +62,18 @@ class User extends BaseApi |
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
//获取用户id
|
|
|
$user_id = $this->get_data('user_id','用户id不能为空');
|
|
|
//更新用户的查看浏览量
|
|
|
//获取用户信息
|
|
|
$user = model('user')->where('id',$this->auth->id)->find();
|
|
|
$user = model('user')->where('id',$user_id)->find();
|
|
|
//查看数量
|
|
|
if (!$user){
|
|
|
$this->error('该用户不存在');
|
|
|
}
|
|
|
//判断用户
|
|
|
$user->show_num += 1;
|
|
|
$user->save();
|
|
|
$this->success('查询用户信息成功', $user);
|
|
|
}
|
|
|
|
...
|
...
|
|