Selaa lähdekoodia

微调获取模块栏目的新闻

15313670163 1 kuukausi sitten
vanhempi
sitoutus
a159f7622d
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      app/JsonRpc/WebsiteService.php

+ 2 - 2
app/JsonRpc/WebsiteService.php

@@ -600,7 +600,6 @@ class WebsiteService implements WebsiteServiceInterface
             ->offset($data['placeid'])
             ->limit($data['num'])
             ->orderBy('sort');
-
         // 如果 $pid 数组不为空,添加 CASE WHEN 条件
         if (!empty($pid)) {
             $placeholders = implode(',', array_fill(0, count($pid), '?'));
@@ -611,7 +610,8 @@ class WebsiteService implements WebsiteServiceInterface
         }
 
         // 执行查询
-        $result = $query->get();
+        $placeid = $data['placeid']-1;
+        $result = $query->offset($placeid)->limit($data['num'])->get();
         if(!empty($result)){ 
             return Result::success($result);  
         }else{