|
|
@@ -483,10 +483,23 @@ class FinanceRepository extends BaseRepository
|
|
483
|
483
|
$sWeekWhere = " 1=1";
|
|
484
|
484
|
$weekWhere = " 1=1";
|
|
485
|
485
|
$dayWhere = " 1=1";
|
|
|
486
|
+
|
|
|
487
|
+ // 获取当前 ISO 年份和周数
|
|
|
488
|
+ $year = $today->format('o'); // ISO-8601 年份
|
|
|
489
|
+ $week = $today->format('W'); // ISO-8601 周数(周一为周起始)
|
|
|
490
|
+
|
|
|
491
|
+ // 本周一:setISODate(年份, 周数, 1) 参数 1 表示周一
|
|
|
492
|
+ $thisMonday = new \DateTime();
|
|
|
493
|
+ $thisMonday->setISODate($year, $week, 1);
|
|
|
494
|
+
|
|
|
495
|
+ // 下周一:周数加1
|
|
|
496
|
+ $nextMonday = new \DateTime();
|
|
|
497
|
+ $nextMonday->setISODate($year, $week + 1, 1);
|
|
|
498
|
+
|
|
486
|
499
|
//上周时间条件
|
|
487
|
500
|
$sWeekWhere .= " and DATE(create_time) >= '" . $startDate . "' and DATE(create_time) <= '" . $endDate . "'";
|
|
488
|
501
|
//周时间条件
|
|
489
|
|
- $weekWhere .= " and DATE(create_time) >= '" . $oneWeekAgoFormatted . "' and DATE(create_time) <= '" . $todayFormatted . "'";
|
|
|
502
|
+ $weekWhere .= " and DATE(create_time) >= '" . $thisMonday->format('Y-m-d') . "' and DATE(create_time) <= '" . $nextMonday->format('Y-m-d') . "'";
|
|
490
|
503
|
//今日时间条件
|
|
491
|
504
|
$dayWhere .= " and DATE(create_time) = '" . $todayFormatted . "'";
|
|
492
|
505
|
$sharedUserCount = Db::name('shared_prosperity_user')->count(); //共富会员总人数
|