|
|
@@ -55,14 +55,16 @@ class GroupActivity extends BaseModel
|
|
|
$where['block_key'] = $block_key;
|
|
|
}
|
|
|
$detail = GroupActivityCategory::where('id',$catetory_id)
|
|
|
- ->field('id,title,images,start_time,end_time,area,participant_num,form_time_limit,is_simulate_form,simulate_num,type')
|
|
|
+ ->field('id,title,images,start_time,end_time,area,participant_num,form_time_limit,is_simulate_form,simulate_num,type,block_data')
|
|
|
->findOrEmpty()
|
|
|
->toArray();
|
|
|
$category = [
|
|
|
'id' => $detail['id'],
|
|
|
'title' => $detail['title'],
|
|
|
'images' => explode(",",$detail['images']),
|
|
|
+ 'block_data' => json_decode($detail['block_data'],true),
|
|
|
];
|
|
|
+ unset($detail['block_data']);
|
|
|
$detail = array_diff_key($detail,$category);
|
|
|
$detail['area'] = explode(",",$detail['area']);
|
|
|
$detail['participant_num'] = explode(",",$detail['participant_num']);
|
|
|
@@ -77,7 +79,12 @@ class GroupActivity extends BaseModel
|
|
|
$list[$item['block_key']]['block_key'] = $item['block_key'];
|
|
|
$list[$item['block_key']]['activity'][] = $item;
|
|
|
}
|
|
|
- $category['block_data'] = $list;
|
|
|
+
|
|
|
+ foreach($category['block_data'] as &$item) {
|
|
|
+ if (isset($list[$item['block_key']])) {
|
|
|
+ $item['activity'] = $list[$item['block_key']]['activity'];
|
|
|
+ }
|
|
|
+ }
|
|
|
return $category;
|
|
|
}
|
|
|
|