From 565460b1a969837459bbecbc0be55b8a1cf0e0fc Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Sun, 12 May 2024 17:41:47 +0800 Subject: [PATCH] 1 --- app/api/model/user/BalanceLog.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/model/user/BalanceLog.php b/app/api/model/user/BalanceLog.php index e56a46ac..9cd628e2 100644 --- a/app/api/model/user/BalanceLog.php +++ b/app/api/model/user/BalanceLog.php @@ -42,12 +42,12 @@ class BalanceLog extends BalanceLogModel $userId = UserService::getCurrentLoginUserId(); // 获取列表数据 $query = $this->where('user_id', '=', $userId); - if(!empty($params['type'])){ - $query = $query->where('scene','=',$params['type']); + if (!empty($params['type'])) { + $query = $query->where('scene', '=', $params['type']); } - if(!empty($params['start_at']) && empty($params['end_at'])){ - $query = $query->where('create_time','>=',strtotime($params['start_at'])); - $query = $query->where('create_time','<=',strtotime($params['end_at'])); + if (!empty($params['start_at']) && !empty($params['end_at'])) { + $query = $query->where('create_time', '>=', strtotime($params['start_at'])); + $query = $query->where('create_time', '<=', strtotime($params['end_at'])); } return $query->order(['create_time' => 'desc']) ->paginate(15);