作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

合并分支 'heshupeng' 到 'master'

api注释



查看合并请求 !102
... ... @@ -178,10 +178,10 @@ class HouseAdmin extends Api
$mobile = $this->request->param('mobile');
$captcha = $this->request->param('captcha');
if (!$house_id || !$mobile || !$captcha) {
$this->error(__('Invalid parameters'));
$this->error('缺少必要参数');
}
if (!Validate::regex($mobile, "^1\d{10}$")) {
$this->error(__('Mobile is incorrect'));
$this->error('手机号格式不正确');
}
$admin = HouseAdminModel::get(['user_id'=>$this->auth->id,'house_id'=>$house_id]);
empty($admin) && $this->error('您不是该小区的管理员');
... ... @@ -191,11 +191,11 @@ class HouseAdmin extends Api
->where('id', '<>', $admin->id)
->find();
if ($mobile_exists) {
$this->error(__('Mobile already exists'));
$this->error('手机号已被占用');
}
$code = Cache::get($mobile);
if ($code != $captcha) {
$this->error(__('Captcha is incorrect'));
$this->error('验证码不正确');
}
$admin->mobile = $mobile;
$admin->save();
... ... @@ -534,7 +534,15 @@ class HouseAdmin extends Api
* @ApiReturn({
"code": 1,
"msg": "success",
"time": "1598755666"
"time": "1598838987",
"data": {
"total_num": 1, //总条数
"list": [{
"id": 1, //业主ID
"name": "liujianch", //业主名称
"remark": "" //业主备注
}]
}
})
*/
public function userList()
... ... @@ -554,7 +562,7 @@ class HouseAdmin extends Api
->order('createtime desc')
->page($page,$pageNum)
->select();
$this->success('success',$list);
$this->success('success',['total_num'=>count($list),'list'=>$list]);
}
/**
... ... @@ -585,7 +593,7 @@ class HouseAdmin extends Api
$info->remark = $remark;
$info->save();
$this->success('success',$list);
$this->success('success');
}
/**
... ... @@ -627,8 +635,7 @@ class HouseAdmin extends Api
"createtime": "2020-08-30 09:36:45",
}
],
"this_page": 当前页数,
"total_page": 总页数
"total_num": 总条数,
}
})
*/
... ... @@ -652,7 +659,7 @@ class HouseAdmin extends Api
$v['name'] = Db::name('user')->where('id',$v['user_id'])->value('nickname');
}
}
$this->success('success',$list);
$this->success('success',['total_num'=>count($list),'list'=>$list]);
}
/**
... ... @@ -668,22 +675,25 @@ class HouseAdmin extends Api
* @ApiReturn({
"code": 1,
"msg": "success",
"time": "1598837852",
"data": [{
"id": 1,
"user_id": 1,
"house_id": 16,
"house_user_id": 2,
"type": 1, //发送人1 = 用户2 = 社区 / 商家,
"content": "你好", //文字内容
"image": "", //图片
"createtime": "1970-01-01 08:00:00",
"user": {
"time": "1598839065",
"data": {
"total_num": 1, //总条数
"list": [{
"id": 1,
"nickname": "StTazBfCvMrqXc4UHJYn",
"avatar": "http://community.qiniu.brotop.cn/assets/img/avatar.png"
}
}]
"user_id": 1,
"house_id": 16,
"house_user_id": 2,
"type": 1, //发送人1 = 用户2 = 社区 / 商家,
"content": "你好", //文字内容
"image": "", //图片
"createtime": "1970-01-01 08:00:00",
"user": {
"id": 1,
"nickname": "StTazBfCvMrqXc4UHJYn",
"avatar": "http://community.qiniu.brotop.cn/assets/img/avatar.png"
}
}]
}
})
*/
public function messageDetail()
... ... @@ -729,7 +739,7 @@ class HouseAdmin extends Api
}
$v['user'] = $user;
}
$this->success('success',$list);
$this->success('success',['total_num'=>count($list),'list'=>$list]);
}
/**
... ...