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

bug修改

... ... @@ -196,6 +196,10 @@ class HouseAdmin extends Api
empty($house_id) && $this->error('缺少必要参数');
$admin = HouseAdminModel::get(['user_id'=>$this->auth->id,'house_id'=>$house_id]);
if(!$admin){
$house = House::get($house_id);
$admin = HouseAdminModel::get(['id'=>$house['admin_user_id'],'user_id'=>$this->auth->id]);
}
empty($admin) && $this->error('您不是该小区的管理员');
$admin->nickname = $nickname;
... ... @@ -222,6 +226,10 @@ class HouseAdmin extends Api
$this->error('手机号格式不正确');
}
$admin = HouseAdminModel::get(['user_id'=>$this->auth->id,'house_id'=>$house_id]);
if(!$admin){
$house = House::get($house_id);
$admin = HouseAdminModel::get(['id'=>$house['admin_user_id'],'user_id'=>$this->auth->id]);
}
empty($admin) && $this->error('您不是该小区的管理员');
// 检查手机号是否存在
$mobile_exists = HouseAdminModel::where('mobile',$mobile)
... ... @@ -439,6 +447,10 @@ class HouseAdmin extends Api
empty($post['title']) && $this->error('请填写公告标题');
empty($post['content']) && $this->error('请填写公告内容');
$admin = HouseAdminModel::get(['user_id'=>$this->auth->id,'house_id'=>$post['house_id']]);
if(!$admin){
$house = House::get($post['house_id']);
$admin = HouseAdminModel::get(['id'=>$house['admin_user_id'],'user_id'=>$this->auth->id]);
}
empty($admin) && $this->error('您不是该小区的管理员');
$count = HouseBoard::whereTime('createtime', 'week')
->where('house_id',$post['house_id'])
... ... @@ -507,6 +519,10 @@ class HouseAdmin extends Api
$this->error('缺少必要参数');
}
$admin = HouseAdminModel::get(['user_id'=>$this->auth->id,'house_id'=>$house_id]);
if(!$admin){
$house = House::get($house_id);
$admin = HouseAdminModel::get(['id'=>$house['admin_user_id'],'user_id'=>$this->auth->id]);
}
empty($admin) && $this->error('您不是该小区的管理员');
$info = HouseBoard::get(['house_id'=>$house_id,'id'=>$house_board_id]);
empty($info) && $this->error('公告信息不存在');
... ...