瀏覽代碼

fix(product): 修复产品统计查询逻辑

- 移除多余的 whereNull('spu_id') 条件以正确统计所有产品数量
- 确保出售中产品的计数包含所有相关记录而不过滤 spu_id 为空的情况
shichen 2 月之前
父節點
當前提交
25c9ca6b09
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/common/repositories/store/product/ProductRepository.php

+ 1 - 1
app/common/repositories/store/product/ProductRepository.php

@@ -654,7 +654,7 @@ class ProductRepository extends BaseRepository
654
         $result[] = [
654
         $result[] = [
655
             'type'  => 1,
655
             'type'  => 1,
656
             'name'  => '出售中' . $name,
656
             'name'  => '出售中' . $name,
657
-            'count' => $this->dao->search($merId, $this->switchType(1, $merId, $productType))->whereNull('spu_id')->count()
657
+            'count' => $this->dao->search($merId, $this->switchType(1, $merId, $productType))->count()
658
         ];
658
         ];
659
         $result[] = [
659
         $result[] = [
660
             'type'  => 2,
660
             'type'  => 2,