|
|
@@ -30,11 +30,20 @@ class GroupActivityLogic extends BaseLogic
|
|
|
/**
|
|
|
* 活动分类数据
|
|
|
*/
|
|
|
- public static function categoryList($id){
|
|
|
+ public static function categoryList($id,$block_key = ''){
|
|
|
+
|
|
|
$detail = GroupActivityCategory::where('id',$id)->where('status',1)->field('id,title,images,block_data')->findOrEmpty()->toArray();
|
|
|
if($detail) {
|
|
|
- $detail['images'] = $detail['images'] ? explode(",",$detail['images']) : [];
|
|
|
$detail['block_data'] = $detail['block_data'] ? json_decode($detail['block_data'],true) : [];
|
|
|
+ if ($block_key) {
|
|
|
+ foreach($detail['block_data'] as $item) {
|
|
|
+ if ($block_key == $item['block_key']) {
|
|
|
+ return $item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $detail['images'] = $detail['images']? explode(",",$detail['images']) : [];
|
|
|
+ }
|
|
|
}
|
|
|
return $detail;
|
|
|
}
|