...
|
...
|
@@ -102,12 +102,14 @@ class House extends Api |
|
|
$info['createtime'] = '';
|
|
|
$info['look_num'] = '';
|
|
|
$info['is_new'] = 2;
|
|
|
$info['id'] = '';
|
|
|
}else{
|
|
|
$info['is_have'] = 1;
|
|
|
$info['title'] = $house_board['title'];
|
|
|
$info['content'] = $house_board['content'];
|
|
|
$info['look_num'] = $house_board['look_num'];
|
|
|
$info['createtime'] = date('Y-m-d',$house_board['createtime']);
|
|
|
$info['id'] = $house_board['id'];
|
|
|
|
|
|
//查询是否已读
|
|
|
$is_read = Db::name('house_board_detail')->where('user_id',$user_id)->where('house_board_id',$house_board['id'])->find();
|
...
|
...
|
@@ -491,16 +493,24 @@ class House extends Api |
|
|
if (!$validate->check($param)) {
|
|
|
$this->error($validate->getError());
|
|
|
}
|
|
|
$param['createtime'] = time();
|
|
|
$param['updatetime'] = time();
|
|
|
$data = Db::name('user_house')->insertGetId($param);
|
|
|
if(empty($data)){
|
|
|
$this->error('申请失败');
|
|
|
|
|
|
$info = Db::name('user_house')->where('user_id',$param['user_id'])->where('house_id',$param['house_id'])->find();
|
|
|
if(empty($info)){
|
|
|
$param['createtime'] = time();
|
|
|
$param['updatetime'] = time();
|
|
|
$data = Db::name('user_house')->insertGetId($param);
|
|
|
if(empty($data)){
|
|
|
$this->error('申请失败');
|
|
|
}else{
|
|
|
Db::name('user')->where('id',$param['user_id'])->update(['mobile'=>$param['phone']]);
|
|
|
$this->success('成功');
|
|
|
}
|
|
|
}else{
|
|
|
Db::name('user')->where('id',$param['user_id'])->update(['mobile'=>$param['phone']]);
|
|
|
$this->success('成功');
|
|
|
$this->error('您已经绑定过该小区了');
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|