|
|
@@ -4210,10 +4210,10 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
// var_dump("sector_ids",$sector_ids);
|
|
|
//
|
|
|
// 各类型通栏最大数量数量限制 = 规则最大数量-已经存在的通栏数量(目前的通栏不会有重复的,所以只是-1)
|
|
|
-
|
|
|
+ if(empty($sector)){
|
|
|
+ return $sector;
|
|
|
+ }
|
|
|
// var_dump("sector",$sector);
|
|
|
-
|
|
|
-
|
|
|
// 处理头条及轮播图在随机通栏中的特殊位置特殊处理
|
|
|
$sector_specal_sort = array_column($sector, 'sector_type');
|
|
|
if (in_array(6, $sector_specal_sort) || in_array(7, $sector_specal_sort) || in_array(5, $sector_specal_sort)) {
|
|
|
@@ -4343,6 +4343,8 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$y_num = $y_num + $value['pic_height'];
|
|
|
// $componentData = [];
|
|
|
$sector_component = [];
|
|
|
+ $ad_key = 0;
|
|
|
+ $ad = [];
|
|
|
for ($i = 0; $i < $value['component_num']; $i++) {
|
|
|
// $component_data = [];
|
|
|
$componentData = [];
|
|
|
@@ -4408,10 +4410,12 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$component_imgkey = array_search($component_imgid, $component_imgids);
|
|
|
$ad_data['thumb'] = $component_imgs[$component_imgkey]['img_url'];
|
|
|
if ($component_type == 24) {
|
|
|
- $ad[0] = $ad_data;
|
|
|
- $ad[1] = $ad_data;
|
|
|
+ $ad[$ad_key] = $ad_data;
|
|
|
+ $ad[$ad_key + 1] = $ad_data;
|
|
|
+ $ad_key += 2;
|
|
|
} else {
|
|
|
- $ad = $ad_data;
|
|
|
+ $ad[$ad_key] = $ad_data;
|
|
|
+ $ad_key++;
|
|
|
}
|
|
|
$template_data[$key]['ad'] = $ad;
|
|
|
$canvas_data[$key]['content']['ad'] = $ad;
|
|
|
@@ -4435,8 +4439,8 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
// $page['template'][$key][$sector_key]['componentData'] = $result[$sectorId];
|
|
|
}
|
|
|
$datas['component'][0] = [
|
|
|
- 'template_data' => $template_data,
|
|
|
- 'canvas_data' => $canvas_data,
|
|
|
+ 'template_data' => $template_data ?? [],
|
|
|
+ 'canvas_data' => $canvas_data ?? [],
|
|
|
];
|
|
|
return $datas;
|
|
|
}
|