作者 Cool
1 个管道 的构建 通过 耗费 1 秒

Merge branch 'master' of http://114.215.101.231:8099/guosheng/community into liuzhen

... ... @@ -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,50 +659,40 @@ 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]);
}
/**
* @ApiTitle (社区管理员-留言消息)
* @ApiSummary (社区管理员-留言消息)
* @ApiTitle (社区管理员-留言消息-详情)
* @ApiSummary (社区管理员-留言消息-详情)
* @ApiMethod (POST)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="house_id", type="inter", required=true, description="社区ID")
* @ApiParams (name="message_id", type="inter", required=true, description="消息ID")
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
* @ApiParams (name="pageNum", type="inter", required=false, description="每页显示数据个数(默认10)")
*
* @ApiReturn({
'code': '1',
'msg': '返回成功',
"code": 1,
"msg": "success",
"time": "1598839065",
"data": {
"total_num": 1, //总条数
"list": [{
"id": 3,
"user_id": 1,
"object_id": 1,
"object_user_id": 1,
"type": 消息类型1 = 平台2 = 商家3 = 社区,
"content": "文字内容",
"image": "图片",
"is_read_user": 是否已读1 = 是2 = 否,
"name": "平台/店铺/社区名称"
"createtime": "2020-08-30 10:43:55",
},
{
"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": {
"id": 1,
"user_id": 1,
"object_id": 1,
"object_user_id": 1,
"type": 1,
"content": "123",
"image": "",
"is_read_user": 1,
"name": "平台消息"
"createtime": "2020-08-30 09:36:45",
"nickname": "StTazBfCvMrqXc4UHJYn",
"avatar": "http://community.qiniu.brotop.cn/assets/img/avatar.png"
}
],
"this_page": 当前页数,
"total_page": 总页数
}]
}
})
*/
... ... @@ -742,7 +739,7 @@ class HouseAdmin extends Api
}
$v['user'] = $user;
}
$this->success('success',$list);
$this->success('success',['total_num'=>count($list),'list'=>$list]);
}
/**
... ...
... ... @@ -140,6 +140,7 @@ class User extends Api
'id',
'username',
'nickname',
'mobile',
'avatar',
'id_num',
'money',
... ...