소스 검색

修改b端通栏管理-获取所有皮肤

15313670163 5 일 전
부모
커밋
bcbec91c0d
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      app/JsonRpc/PublicRpcService.php

+ 8 - 1
app/JsonRpc/PublicRpcService.php

@@ -941,7 +941,14 @@ class PublicRpcService implements PublicRpcServiceInterface
      */
     public function getAllTemplate(array $data): array
     {
-        $result = Template::get()->all();
+        $where = [];
+        if(isset($data['template_class_id'])){
+            $where['template_class_id'] = $data['template_class_id'];
+        }
+        if(isset($data['template_name'])){
+            $where['template_name'] = ['like','%'.$data['template_name'].'%'];
+        }
+        $result = Template::where($where)->get()->all();
         if(empty($result)){
             return Result::error("暂无皮肤", 0);
         }