Parcourir la source

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

- 移除多余的 whereNull('spu_id') 条件以正确统计所有产品数量
- 确保出售中产品的计数包含所有相关记录而不过滤 spu_id 为空的情况
shichen il y a 2 mois
Parent
commit
25c9ca6b09
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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 654
         $result[] = [
655 655
             'type'  => 1,
656 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 659
         $result[] = [
660 660
             'type'  => 2,