Browse Source

Merge branch '20250522_diywebfr'

15313670163 3 days ago
parent
commit
bbcaec68e5
1 changed files with 8 additions and 1 deletions
  1. 8 1
      app/JsonRpc/PublicRpcService.php

+ 8 - 1
app/JsonRpc/PublicRpcService.php

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