15313670163 4 月之前
父節點
當前提交
b7d3648157
共有 1 個文件被更改,包括 7 次插入15 次删除
  1. 7 15
      app/JsonRpc/WebsiteService.php

+ 7 - 15
app/JsonRpc/WebsiteService.php

@@ -1292,6 +1292,7 @@ class WebsiteService implements WebsiteServiceInterface
      */
     public function getWebsiteTemplateList(array $data): array
     {
+
         $website = Website::where('website.id',$data['website_id'])->first();
         if(empty($website)){
             return Result::error("请输入正确的网站id!",0);
@@ -1325,7 +1326,8 @@ class WebsiteService implements WebsiteServiceInterface
                                 }
                             })->count();
                     }
-                } else {
+                }else{
+
                     //获取所有模板
                     $rep = Template::where(function ($query) use ($where) {
                                 foreach ($where as $value) {
@@ -1340,20 +1342,9 @@ class WebsiteService implements WebsiteServiceInterface
                         foreach ($where as $value) {
                             $query->whereJsonContains('template_img', ['value' => $value]);
                         }
-                    })
-                        ->leftJoin('template_class', 'template_class.id', 'template.template_class_id')
-                        ->select('template.*', 'template_class.name', 'template_class.id as class_id')
-                        ->limit($data['pageSize'])
-                        ->offset(($data['page'] - 1) * $data['pageSize'])
-                        ->orderBy("template.updated_at", "desc")
-                        ->get();
-                    $count = Template::where('template_class_id', $data['template_class_id'])
-                        ->where(function ($query) use ($where) {
-                            foreach ($where as $value) {
-                                $query->whereJsonContains('template_img', ['value' => $value]);
-                            }
-                        })->count();
-
+                    })->count();
+                        
+                    
                 }
                 if(empty($rep) || $rep->count()==0){
                     return Result::error("没有查找到相关数据!",0);
@@ -1395,6 +1386,7 @@ class WebsiteService implements WebsiteServiceInterface
             }
         }
             return Result::success($result);
+            
     }
 
     /**