소스 검색

修改版式的画布数据

FengR 1 개월 전
부모
커밋
8f60bdc98a
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      app/JsonRpc/PublicRpcService.php

+ 7 - 0
app/JsonRpc/PublicRpcService.php

@@ -2507,6 +2507,13 @@ class PublicRpcService implements PublicRpcServiceInterface
         if (empty($sector_type_info)) {
         if (empty($sector_type_info)) {
             return Result::error('通栏版式类别不存在!');
             return Result::error('通栏版式类别不存在!');
         }
         }
+        $allcomponent_type = array_column($component, 'type');
+        if($sector_type_info['column_num'] > 1 && in_array(13,$allcomponent_type)){
+            $aboutArtcle_catkey = array_search(13,$allcomponent_type);
+            // 确保取到的是数字类型的 width,避免与模型对象相乘
+            $width = (int) ($component[$aboutArtcle_catkey]['width'] ?? 1);
+            $sector_type_info['width'] = $sector_type_info['width'] + $width;
+        }
         $row_num = 1;
         $row_num = 1;
         $cat_num = 0;
         $cat_num = 0;
         $row_width = [];
         $row_width = [];