Browse Source

修改接口:组件管理-获取组件类型

15313670163 11 hours ago
parent
commit
a55abc3132
1 changed files with 5 additions and 1 deletions
  1. 5 1
      app/JsonRpc/PublicRpcService.php

+ 5 - 1
app/JsonRpc/PublicRpcService.php

@@ -2121,7 +2121,11 @@ class PublicRpcService implements PublicRpcServiceInterface
      */
     public function getComponentType(array $data): array
     {
-        $component_type = ComponentType::get()->all();
+        $where = [];
+        if(isset($data['id']) && !empty($data['id'])){
+            $where['id'] = $data['id'];
+        }
+        $component_type = ComponentType::where($where)->get()->all();
         $article = Article::first()->toArray();
         $category = WebsiteCategory::first()->toArray();
         $footer_category = FooterCategory::first()->toArray();