|
|
@@ -3196,7 +3196,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$query = WebsiteCategory::where('website_id', $data['website_id']);
|
|
|
$cate_num = $query->where('is_show', 1)->count();
|
|
|
if ($cate_num < 5) {
|
|
|
- return Result::error('此网站栏目过少,无法进行随机模板!');
|
|
|
+ return'此网站栏目过少,无法进行随机模板!';
|
|
|
}
|
|
|
$cate_num = min($cate_num, 24);
|
|
|
// return Result::success($data);
|
|
|
@@ -3926,7 +3926,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$cate_num = count($all_cate);
|
|
|
// return $all_cate;
|
|
|
if ($cate_num < 5) {
|
|
|
- return Result::error('此网站栏目过少,无法进行随机模板!');
|
|
|
+ return 此网站栏目过少,无法进行随机模板!;
|
|
|
}
|
|
|
$cate_num = min($cate_num, 24);
|
|
|
$all_sector_type = array_column($sectors, 'sector_type');
|
|
|
@@ -4180,7 +4180,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$date = substr($date, 0, 9); // 截取前9位
|
|
|
}
|
|
|
$random_num = intval(intval($date) . rand(1000, 9999)); // 拼接4位随机数,组成13位随机数
|
|
|
- $y_num = $y_num + $value['pic_height'];
|
|
|
+
|
|
|
$sector_width = $value['sector_width'] / 100;
|
|
|
$canvas_data[$key] = [
|
|
|
'i' => $random_num,
|
|
|
@@ -4193,6 +4193,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
'sectorName' => $value['sector_id'],
|
|
|
]
|
|
|
];
|
|
|
+ $y_num = $y_num + $value['pic_height'];
|
|
|
// $componentData = [];
|
|
|
$sector_component = [];
|
|
|
for ($i = 0; $i < $value['component_num']; $i++) {
|
|
|
@@ -4204,18 +4205,21 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
$list_type = json_decode($value['sector_components'][$i]['component']['component_column'] ?? '[]',true) ?? [];
|
|
|
if(!empty($component_data) && !empty($list_type)){
|
|
|
$componentData = $component_data['componentData'];
|
|
|
- $componentData['listType'] = $list_type['listType'];
|
|
|
+ if($component_type != 10){
|
|
|
+ $componentData['listType'] = $list_type['listType'];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
if(in_array($component_type,[7,14,15,23,24]) && ($page == 1 || $page == 2)){
|
|
|
if($page == 1){
|
|
|
if(in_array($component_type,[23,24])){
|
|
|
- $componentData[0]['name'] = $all_cate[$cat_key]['name'];
|
|
|
+ $componentData[0]['name'] = $all_cate[$cat_key]['alias'];
|
|
|
$componentData[0]['category_arr'] = $all_cate[$cat_key]['category_arr_id'];
|
|
|
- $componentData[1]['name'] = $all_cate[$cat_key+1]['name'];
|
|
|
+ $componentData[1]['name'] = $all_cate[$cat_key+1]['alias'];
|
|
|
$componentData[1]['category_arr'] = $all_cate[$cat_key+1]['category_arr_id'];
|
|
|
$cat_key += 2;
|
|
|
}else{
|
|
|
- $componentData['name'] = $all_cate[$cat_key]['name'];
|
|
|
+ $componentData['name'] = $all_cate[$cat_key]['alias'];
|
|
|
$componentData['category_arr'] = $all_cate[$cat_key]['category_arr_id'];
|
|
|
$cat_key ++;
|
|
|
}
|
|
|
@@ -4247,7 +4251,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
'component_type' => $value['sector_components'][$i]['component']['component_type'],
|
|
|
'sort' => $value['sector_components'][$i]['sort_id'],
|
|
|
'type_id' => $component_type,
|
|
|
- 'page' => $page,
|
|
|
+ // 'page' => $page,
|
|
|
'component_style' => $component_imgids[array_rand($component_imgids)], // 若是上个数组为[1]随机为0,原因:array_rand 在单元素数组时必然返回 0
|
|
|
'componentData' => $componentData,
|
|
|
|