Browse Source

建立接口:组件管理-获取所有通栏、自助建站-流程管理-获取所有组件

15313670163 14 hours ago
parent
commit
f8451e5723
2 changed files with 43 additions and 0 deletions
  1. 38 0
      app/JsonRpc/PublicRpcService.php
  2. 5 0
      app/JsonRpc/PublicRpcServiceInterface.php

+ 38 - 0
app/JsonRpc/PublicRpcService.php

@@ -2175,4 +2175,42 @@ class PublicRpcService implements PublicRpcServiceInterface
         }
         return Result::success($component_type);
     }
+    /**
+     * 组件管理-获取所有组件
+     */
+    public function getAllComponent(array $data): array
+    {
+        $where = [];
+        if(isset($data['sector_id']) && !empty($data['sector_id'])){
+            $where['sector_id'] = $data['sector_id'];
+        }
+        if(isset($data['sort_id']) && !empty($data['sort_id'])){
+            $where['sort_id'] = $data['sort_id'];
+        }
+        $component = Component::where($where)->get()->all();
+        if(empty($component)){
+            return Result::error('组件不存在!');
+        }
+        return Result::success($component);
+    }
+    /**
+     * 自助建站-流程管理-获取所有通栏
+     */
+    public function getAllSector(array $data): array
+    {
+        $where = [];
+         if(isset($data['template_id']) && !empty($data['template_id'])){
+            $where['template_id'] = $data['template_id'];
+        }
+        if(isset($data['page_type']) && !empty($data['page_type'])){
+            array_push($where,['page_type', 'like', '%'.$data['page_type'].'%']);
+            // $where['page_type'] = ['like','%'.$data['page_type'].'%'];
+        }
+        // return Result::success($where);
+        $sector = Sector::where($where)->get()->all();
+        if(empty($sector)){
+            return Result::error('通栏不存在!');
+        }
+        return Result::success($sector);
+    }
 }

+ 5 - 0
app/JsonRpc/PublicRpcServiceInterface.php

@@ -194,4 +194,9 @@ interface PublicRpcServiceInterface
     public function getAllSectorPlace(array $data): array;
     //组件管理-获取组件类型
     public function getComponentType(array $data): array;
+    //自助建站-流程管理-获取所有通栏
+    public function getAllSector(array $data): array;
+    //组件管理-获取所有组件
+    public function getAllComponent(array $data): array;
+
 }