瀏覽代碼

Merge branch 'web_sannong_fr'

15313670163 6 天之前
父節點
當前提交
80209160b6
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/JsonRpc/NewsService.php

+ 2 - 2
app/JsonRpc/NewsService.php

@@ -2089,7 +2089,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()
@@ -2099,7 +2099,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()