...
|
...
|
@@ -648,19 +648,9 @@ class HouseBoard extends Api |
|
|
*/
|
|
|
private function getActivityList($where){
|
|
|
$list = Db::name('house_activity')
|
|
|
->alias('ha')
|
|
|
->join('house_join hj','ha.id = hj.house_activity_id and hj.user_id ='.$this->auth->id,'left')
|
|
|
->where($where)
|
|
|
->field('
|
|
|
ha.id,
|
|
|
ha.title,
|
|
|
ha.content,
|
|
|
ha.start_time,
|
|
|
ha.end_time,
|
|
|
ha.spec_type,
|
|
|
hj.join_status
|
|
|
')
|
|
|
->order("ha.createtime desc")
|
|
|
->field('id,title,content,start_time,end_time,spec_type')
|
|
|
->order('createtime desc')
|
|
|
->select();
|
|
|
foreach ($list as $k => &$v) {
|
|
|
// 活动报名费用
|
...
|
...
|
@@ -669,13 +659,18 @@ class HouseBoard extends Api |
|
|
// 活动日期
|
|
|
$v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']);
|
|
|
// 活动状态
|
|
|
if($v['join_status'] == '1'){
|
|
|
$join = Db::name('house_join')
|
|
|
->where('house_activity_id',$v['id'])
|
|
|
->where('user_id',$this->auth->id)
|
|
|
->where('join_status','1')
|
|
|
->find();
|
|
|
if($join){
|
|
|
$status = ['text'=>'已报名','value'=>1];
|
|
|
}else{
|
|
|
$status = $v['end_time'] < time() ? ['text'=>'已到期','value'=>2] : ['text'=>'报名中','value'=>0];
|
|
|
}
|
|
|
$v['status'] = $status;
|
|
|
unset($v['start_time'],$v['end_time'],$v['join_status']);
|
|
|
unset($v['start_time'],$v['end_time']);
|
|
|
}
|
|
|
return $list;
|
|
|
}
|
...
|
...
|
|