瀏覽代碼

Merge branch '20250522_diywebfr'

15313670163 5 天之前
父節點
當前提交
9fd3c4f8f9
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. 9 3
      app/JsonRpc/PublicRpcService.php

+ 9 - 3
app/JsonRpc/PublicRpcService.php

@@ -2106,12 +2106,18 @@ class PublicRpcService implements PublicRpcServiceInterface
         if(isset($data['id']) && !empty($data['id'])){
             $where['id'] = $data['id'];
         }
-        $component_type = ComponentType::where($where)->first();
+        $component_type = ComponentType::where($where)->get()->all();
         if(empty($component_type)){
             return Result::error('组件类型不存在!');
         }
-        $all_code = json_decode($component_type['com_code'] ?? '',true);
-        $component_type['all_code'] = $all_code['listType'] ?? [];
+        if(count($component_type) == 1){
+            $all_code = json_decode($component_type[0]['com_code'] ?? '',true);
+            $component_type[0]['all_code'] = $all_code['listType'] ?? [];
+            $result = $component_type[0];
+        }else{
+            $result = $component_type;
+        }
+       
         if(empty($component_type)){
             return Result::error('组件类型不存在!');
         }