From e14047c48a8be6b017b39e5762c7f94e717d0e8f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 24 Jul 2023 15:10:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/AccountLogLists.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/api/lists/AccountLogLists.php b/app/api/lists/AccountLogLists.php index 3109fafe3..45329304f 100755 --- a/app/api/lists/AccountLogLists.php +++ b/app/api/lists/AccountLogLists.php @@ -46,7 +46,13 @@ class AccountLogLists extends BaseApiDataLists if (!empty($this->params['action'])) { $where[] = ['action', '=', $this->params['action']]; } - + // 变动时间 + if (!empty($this->params['time'])) { + $date= strtotime($this->params['time']); + $startTime = strtotime($date) - 3600; // 获取该日期零点的时间戳 + $endTime = strtotime($date) + 86400; // 获取该日期24小时后的时间戳 + $where[] = ['create_time', 'between time',[$startTime, $endTime]]; + } return $where; } @@ -90,4 +96,4 @@ class AccountLogLists extends BaseApiDataLists { return UserAccountLog::where($this->queryWhere())->count(); } -} \ No newline at end of file +} From 94dcd14a3a4bbc0751b5f36562a06f6f486aa256 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Mon, 24 Jul 2023 15:25:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/AccountLogLists.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/lists/AccountLogLists.php b/app/api/lists/AccountLogLists.php index 45329304f..9a66489ce 100755 --- a/app/api/lists/AccountLogLists.php +++ b/app/api/lists/AccountLogLists.php @@ -49,8 +49,8 @@ class AccountLogLists extends BaseApiDataLists // 变动时间 if (!empty($this->params['time'])) { $date= strtotime($this->params['time']); - $startTime = strtotime($date) - 3600; // 获取该日期零点的时间戳 - $endTime = strtotime($date) + 86400; // 获取该日期24小时后的时间戳 + $startTime = $date - 3600; // 获取该日期零点的时间戳 + $endTime = $date + 86400; // 获取该日期24小时后的时间戳 $where[] = ['create_time', 'between time',[$startTime, $endTime]]; } return $where;