Sfoglia il codice sorgente

Merge branch '20250522_diywebfr'

15313670163 3 giorni fa
parent
commit
6e3e506199
1 ha cambiato i file con 7 aggiunte e 5 eliminazioni
  1. 7 5
      app/JsonRpc/PublicRpcService.php

+ 7 - 5
app/JsonRpc/PublicRpcService.php

@@ -659,14 +659,16 @@ class PublicRpcService implements PublicRpcServiceInterface
         }
         $template = TemplateClass::when($where, function ($query) use ($where) {
                 $query->where($where);
-            })
+            });
+            
+        
+        $count = $template->count();
+        // $countQuery = clone $template;
+        $row = $template
             ->leftJoin('template', 'template_class.id', '=', 'template.template_class_id')
             ->select('template_class.*', DB::raw('COUNT(template.id) as template_count'))
             ->groupBy('template_class.id')
-            ->orderBy('template_class.updated_at', 'desc');
-        $countQuery = clone $template;
-        $count = $countQuery->count();
-        $row = $template
+            ->orderBy('template_class.updated_at', 'desc')
             ->offset(($data['page'] - 1) * $data['pageSize'])
             ->limit($data['pageSize'])
             ->get();