Просмотр исходного кода

fix(finance): 修复财务报表时间筛选字段错误

- 将上周时间条件中的 create_time 字段更改为 take_time 字段
- 将周时间条件中的 create_time 字段更改为 take_time 字段
- 将今日时间条件中的 create_time 字段更改为 take_time 字段
- 确保时间筛选逻辑使用正确的字段进行查询
shichen месяцев назад: 3
Родитель
Сommit
a962507a71
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      app/common/repositories/finance/FinanceRepository.php

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

@@ -503,11 +503,11 @@ class FinanceRepository extends BaseRepository
503
         $lastMonday->setISODate($year, $week - 1, 1);
503
         $lastMonday->setISODate($year, $week - 1, 1);
504
 
504
 
505
         //上周时间条件
505
         //上周时间条件
506
-        $sWeekWhere .= " and DATE(create_time) >= '" . $lastMonday->format('Y-m-d') . "' and DATE(create_time) < '" . $thisMonday->format('Y-m-d') . "'";
506
+        $sWeekWhere .= " and DATE(take_time) >= '" . $lastMonday->format('Y-m-d') . "' and DATE(take_time) < '" . $thisMonday->format('Y-m-d') . "'";
507
         //周时间条件
507
         //周时间条件
508
-        $weekWhere .= " and DATE(create_time) >= '" . $thisMonday->format('Y-m-d') . "' and DATE(create_time) < '" . $nextMonday->format('Y-m-d') . "'";
508
+        $weekWhere .= " and DATE(take_time) >= '" . $thisMonday->format('Y-m-d') . "' and DATE(take_time) < '" . $nextMonday->format('Y-m-d') . "'";
509
         //今日时间条件
509
         //今日时间条件
510
-        $dayWhere .= " and DATE(create_time) = '" . $todayFormatted . "'";
510
+        $dayWhere .= " and DATE(take_time) = '" . $todayFormatted . "'";
511
 
511
 
512
         // 测试账号
512
         // 测试账号
513
         $testUids = Db::name('user')->where('test_user',  '1')->column('uid');
513
         $testUids = Db::name('user')->where('test_user',  '1')->column('uid');