Ver Fonte

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

15313670163 há 18 horas atrás
pai
commit
a55abc3132
1 ficheiros alterados com 5 adições e 1 exclusões
  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();