Browse Source

fix(finance): 修复周统计时间范围查询条件

- 修改上周时间条件,将结束日期的 <= 改为 <
- 修改本周时间条件,将结束日期的 <= 改为 <
- 确保时间范围查询不会重复计算边界日期数据
shichen 4 months ago
parent
commit
7f05e8d6ae
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/common/repositories/finance/FinanceRepository.php

+ 2 - 2
app/common/repositories/finance/FinanceRepository.php

@@ -501,9 +501,9 @@ class FinanceRepository extends BaseRepository
501
         $lastMonday->setISODate($year, $week - 1, 1);
501
         $lastMonday->setISODate($year, $week - 1, 1);
502
 
502
 
503
         //上周时间条件
503
         //上周时间条件
504
-        $sWeekWhere .= " and DATE(create_time) >= '" . $lastMonday->format('Y-m-d') . "' and DATE(create_time) <= '" . $thisMonday->format('Y-m-d') . "'";
504
+        $sWeekWhere .= " and DATE(create_time) >= '" . $lastMonday->format('Y-m-d') . "' and DATE(create_time) < '" . $thisMonday->format('Y-m-d') . "'";
505
         //周时间条件
505
         //周时间条件
506
-        $weekWhere .= " and DATE(create_time) >= '" . $thisMonday->format('Y-m-d') . "' and DATE(create_time) <= '" . $nextMonday->format('Y-m-d') . "'";
506
+        $weekWhere .= " and DATE(create_time) >= '" . $thisMonday->format('Y-m-d') . "' and DATE(create_time) < '" . $nextMonday->format('Y-m-d') . "'";
507
         //今日时间条件
507
         //今日时间条件
508
         $dayWhere .= " and DATE(create_time) = '" . $todayFormatted . "'";
508
         $dayWhere .= " and DATE(create_time) = '" . $todayFormatted . "'";
509
         $sharedUserCount = Db::name('shared_prosperity_user')->count(); //共富会员总人数
509
         $sharedUserCount = Db::name('shared_prosperity_user')->count(); //共富会员总人数