Pārlūkot izejas kodu

获取商品列表-求购商品搜索问题

15313670163 6 dienas atpakaļ
vecāks
revīzija
da93651085
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      app/JsonRpc/NewsService.php

+ 2 - 2
app/JsonRpc/NewsService.php

@@ -1629,7 +1629,7 @@ class NewsService implements NewsServiceInterface
             ->select('good.id', 'good.name', 'good.imgurl', 'good.description', 'good.updated_at', 
             'good.catid','good.type_id','good.website_id','good.cat_arr_id','good.created_at','good.city_id')
             ->latest('updated_at');
-            $result['type1_count'] = $query->where('type_id', 1)->count();
+            $result['type1_count'] = $query->clone()->where('type_id', 1)->count();
             // 获取 type_id 为 1 的数据
             $result['type1'] = $this->processGoods(
                 $query->clone()
@@ -1639,7 +1639,7 @@ class NewsService implements NewsServiceInterface
                     ->get(),
                 $data
             );
-            $result['type2_count'] = $query->where('type_id', 2)->count();
+            $result['type2_count'] = $query->clone()->where('type_id', 2)->count();
             // 获取 type_id 为 2 的数据
             $result['type2'] = $this->processGoods(
                 $query->clone()