|
@@ -648,19 +648,9 @@ class HouseBoard extends Api |
|
@@ -648,19 +648,9 @@ class HouseBoard extends Api |
648
|
*/
|
648
|
*/
|
649
|
private function getActivityList($where){
|
649
|
private function getActivityList($where){
|
650
|
$list = Db::name('house_activity')
|
650
|
$list = Db::name('house_activity')
|
651
|
- ->alias('ha')
|
|
|
652
|
- ->join('house_join hj','ha.id = hj.house_activity_id and hj.user_id ='.$this->auth->id,'left')
|
|
|
653
|
->where($where)
|
651
|
->where($where)
|
654
|
- ->field('
|
|
|
655
|
- ha.id,
|
|
|
656
|
- ha.title,
|
|
|
657
|
- ha.content,
|
|
|
658
|
- ha.start_time,
|
|
|
659
|
- ha.end_time,
|
|
|
660
|
- ha.spec_type,
|
|
|
661
|
- hj.join_status
|
|
|
662
|
- ')
|
|
|
663
|
- ->order("ha.createtime desc")
|
652
|
+ ->field('id,title,content,start_time,end_time,spec_type')
|
|
|
653
|
+ ->order('createtime desc')
|
664
|
->select();
|
654
|
->select();
|
665
|
foreach ($list as $k => &$v) {
|
655
|
foreach ($list as $k => &$v) {
|
666
|
// 活动报名费用
|
656
|
// 活动报名费用
|
|
@@ -669,13 +659,18 @@ class HouseBoard extends Api |
|
@@ -669,13 +659,18 @@ class HouseBoard extends Api |
669
|
// 活动日期
|
659
|
// 活动日期
|
670
|
$v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']);
|
660
|
$v['activity_time'] = date('Y-m-d',$v['start_time']).'-'.date('Y-m-d',$v['end_time']);
|
671
|
// 活动状态
|
661
|
// 活动状态
|
672
|
- if($v['join_status'] == '1'){
|
662
|
+ $join = Db::name('house_join')
|
|
|
663
|
+ ->where('house_activity_id',$v['id'])
|
|
|
664
|
+ ->where('user_id',$this->auth->id)
|
|
|
665
|
+ ->where('join_status','1')
|
|
|
666
|
+ ->find();
|
|
|
667
|
+ if($join){
|
673
|
$status = ['text'=>'已报名','value'=>1];
|
668
|
$status = ['text'=>'已报名','value'=>1];
|
674
|
}else{
|
669
|
}else{
|
675
|
$status = $v['end_time'] < time() ? ['text'=>'已到期','value'=>2] : ['text'=>'报名中','value'=>0];
|
670
|
$status = $v['end_time'] < time() ? ['text'=>'已到期','value'=>2] : ['text'=>'报名中','value'=>0];
|
676
|
}
|
671
|
}
|
677
|
$v['status'] = $status;
|
672
|
$v['status'] = $status;
|
678
|
- unset($v['start_time'],$v['end_time'],$v['join_status']);
|
673
|
+ unset($v['start_time'],$v['end_time']);
|
679
|
}
|
674
|
}
|
680
|
return $list;
|
675
|
return $list;
|
681
|
}
|
676
|
}
|