Browse Source

发生时间与记账时间

shish 1 ngày trước cách đây
mục cha
commit
18562ef00e
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      app-ghs/controllers/ExpendController.php

+ 4 - 2
app-ghs/controllers/ExpendController.php

@@ -37,8 +37,10 @@ class ExpendController extends BaseController
         $currentEndTime = $currentEndDate . ' 23:59:59';
 
         $where = ['mainId' => $this->mainId];
-        // 汇总默认按记账时间 payTime(与列表默认一致)
-        $where['payTime'] = ['between', [$currentStartTime, $currentEndTime]];
+        // timeType=pay(默认记账 payTime)/ send(发生 sendTime)
+        $timeType = isset($get['timeType']) ? strval($get['timeType']) : 'pay';
+        $timeField = ($timeType === 'send') ? 'sendTime' : 'payTime';
+        $where[$timeField] = ['between', [$currentStartTime, $currentEndTime]];
         $where['delStatus'] = 0; //过滤掉已删除的
         $list = ExpendClass::getAllByCondition($where, null, '*', null);
         $arr = [];