...
|
...
|
@@ -148,7 +148,7 @@ class HouseBoard extends Api |
|
|
* @ApiMethod (POST)
|
|
|
*
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="house_board_id", type=inter, required=true, description="社区id")
|
|
|
* @ApiParams (name="house_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)")
|
|
|
*
|
...
|
...
|
@@ -174,7 +174,7 @@ class HouseBoard extends Api |
|
|
$page = $this->request->param('page', 1, 'intval');
|
|
|
$pageNum = $this->request->param('pageNum', 10, 'intval');
|
|
|
$user_id = $this->auth->id;
|
|
|
$house_id = $this->request->param('house_board_id');
|
|
|
$house_id = $this->request->param('house_id');
|
|
|
if(empty($house_id)){
|
|
|
$this->error('社区id不能为空');
|
|
|
}
|
...
|
...
|
@@ -375,4 +375,56 @@ class HouseBoard extends Api |
|
|
$this->success('success',$info);
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @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="user_id", type="inter", required=true, description="社区物业管理员用户id")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
|
|
"msg": "success",
|
|
|
"time": "1598587213",
|
|
|
"data": [
|
|
|
{
|
|
|
"id": 29,
|
|
|
"title": "1",
|
|
|
"content": "1",
|
|
|
"activity_time": "2020-08-28-2020-08-28",
|
|
|
"status": "已到期"
|
|
|
}
|
|
|
]
|
|
|
})
|
|
|
*/
|
|
|
public function activity()
|
|
|
{
|
|
|
$user_id = $this->auth->id;
|
|
|
$house_id = $this->request->param('house_id'); //社区id
|
|
|
$now = time();
|
|
|
$list = Db::name('house_activity')
|
|
|
->alias('ha')
|
|
|
->join('house_activity_join haj','haj.house_activity_id = ha.id','left')
|
|
|
->where("find_in_set({$house_id},house_ids)")
|
|
|
->field('ha.id,
|
|
|
ha.title,
|
|
|
ha.content,
|
|
|
ha.start_time,
|
|
|
ha.end_time,
|
|
|
haj.join_status
|
|
|
')
|
|
|
->order("ha.createtime desc")
|
|
|
->select();
|
|
|
foreach ($list as $k => &$v) {
|
|
|
// 活动日期
|
|
|
$v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']);
|
|
|
// 活动日期
|
|
|
$v['status'] = $v['join_status'] == 1 ? '已报名' : ($v['end_time'] < time() ? '已到期' : '未报名');
|
|
|
unset($v['start_time'],$v['end_time'],$v['join_status'],);
|
|
|
}
|
|
|
$this->success('success',$list);
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|