Pārlūkot izejas kodu

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

- 修改上周时间条件,将结束日期的 <= 改为 <
- 修改本周时间条件,将结束日期的 <= 改为 <
- 确保时间范围查询不会重复计算边界日期数据
shichen 4 mēneši atpakaļ
vecāks
revīzija
7f05e8d6ae

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

@@ -501,9 +501,9 @@ class FinanceRepository extends BaseRepository
501 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 508
         $dayWhere .= " and DATE(create_time) = '" . $todayFormatted . "'";
509 509
         $sharedUserCount = Db::name('shared_prosperity_user')->count(); //共富会员总人数