Przeglądaj źródła

fix(order): 修复日订单金额统计逻辑

- 在查询条件中添加 test_order 字段过滤,排除测试订单
- 确保只有非测试订单参与日订单金额统计计算
shichen 5 miesięcy temu
rodzic
commit
aa615ce638
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      app/common/dao/store/order/StoreOrderDao.php

+ 1 - 1
app/common/dao/store/order/StoreOrderDao.php

@@ -315,7 +315,7 @@ class StoreOrderDao extends BaseDao
315 315
 
316 316
     public function dayOrderPrice($day, $merId = null)
317 317
     {
318
-        return getModelTime(StoreOrder::getDB()->where('paid', 1)->when($merId, function ($query, $merId) {
318
+        return getModelTime(StoreOrder::getDB()->where('paid', 1)->where('test_order', 0)->when($merId, function ($query, $merId) {
319 319
             $query->where('mer_id', $merId);
320 320
         }), $day, 'pay_time')->sum('pay_price');
321 321
     }