|
@@ -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('组件类型不存在!');
|
|
|
}
|