From 67d6fc5a3ea0474d65772a61f40d6d4ab709e760 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 23 May 2024 17:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=BB=E8=BE=91:=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9Cstart=5Ftime=E8=AE=BE=E7=BD=AE,=20end=5Ftime?= =?UTF-8?q?=E8=AE=BE=E4=B8=BAstart=5Ftime=E5=89=8D7=E5=A4=A9.=20=E5=90=A6?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E4=B8=BA7=E5=A4=A9=E5=89=8D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/financial/FinancialRecordController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/api/controller/financial/FinancialRecordController.php b/app/api/controller/financial/FinancialRecordController.php index 9a561c4..440575f 100644 --- a/app/api/controller/financial/FinancialRecordController.php +++ b/app/api/controller/financial/FinancialRecordController.php @@ -22,11 +22,15 @@ class FinancialRecordController extends BaseApiController public function lists() { $start_time = $this->request->get('start_time'); - $end_time = $this->request->get('end_time'); - if(!isset($start_time)||!isset($end_time)){ + // $end_time = $this->request->get('end_time'); + if(!isset($start_time)){ $start_time=date('Y-m-d',time()); $end_time=date('Y-m-d',strtotime('-7 days')); + }else{ + //start_time设置时间减7天 + $end_time=date('Y-m-d',strtotime('-7 days',strtotime($start_time))); } + $start_time = strtotime($start_time); // 开始时间 $end_time = strtotime($end_time); // 结束时间