From 232760c351040a67dc36ef40dc1d83d8448b7a41 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Mon, 18 Nov 2019 17:01:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=B9=B3=E5=8F=B0->=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=AE=A1=E7=90=86->=E6=AF=8F=E6=97=A5=E6=A6=82?= =?UTF-8?q?=E5=86=B5|=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB--sql=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Base/Repository/SpendRepository.class.php | 8 ++++---- Application/Base/Repository/UserRepository.class.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/Base/Repository/SpendRepository.class.php b/Application/Base/Repository/SpendRepository.class.php index fa0260cd5..79668d255 100644 --- a/Application/Base/Repository/SpendRepository.class.php +++ b/Application/Base/Repository/SpendRepository.class.php @@ -34,14 +34,14 @@ class SpendRepository $gameIds = $params['game_ids'] ?? []; $conditions = []; - $conditions['pay_status'] = 1; $conditions['promote_id'] = ['in', $ids]; - $conditions['pay_time'] = ['between', [$beginTime, $endTime]]; $conditions['game_id'] = ['in', $gameIds]; - $conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; if (!empty($params['server_id'])) { $conditions['server_id'] = $params['server_id']; } + $conditions['pay_way'] = $isBan ? ['neq', '-10'] : ['neq', '-1']; + $conditions['pay_status'] = 1; + $conditions['pay_time'] = ['between', [$beginTime, $endTime]]; return $conditions; } @@ -56,7 +56,6 @@ class SpendRepository $conditions = []; $conditions['pay_status'] = 1; $conditions['promote_id'] = ['in', $ids]; - $conditions['pay_time'] = ['between', [$beginTime, $endTime]]; $conditions['game_id'] = ['in', $gameIds]; if (!empty($params['server_id'])) { $conditions['server_id'] = $params['server_id']; @@ -64,6 +63,7 @@ class SpendRepository if (isset($params['pay_way'])) { $conditions['pay_way'] = $params['pay_way']; } + $conditions['pay_time'] = ['between', [$beginTime, $endTime]]; return $conditions; } diff --git a/Application/Base/Repository/UserRepository.class.php b/Application/Base/Repository/UserRepository.class.php index 87422ee91..b1efad03b 100644 --- a/Application/Base/Repository/UserRepository.class.php +++ b/Application/Base/Repository/UserRepository.class.php @@ -65,13 +65,13 @@ class UserRepository $conditions = []; $conditions['promote_id'] = ['in', $ids]; - $conditions[$params['time_column']] = ['between', [$beginTime, $endTime]]; if (!empty($gameIds)) { $conditions['game_id'] = ['in', $gameIds]; if (!empty($params['server_id'])) { $conditions['server_id'] = $params['server_id']; } } + $conditions[$params['time_column']] = ['between', [$beginTime, $endTime]]; return $conditions; } @@ -107,11 +107,11 @@ class UserRepository $conditions = []; $conditions['promote_id'] = ['in', $ids]; - $conditions[$params['time_column']] = ['between', [$beginTime, $endTime]]; $conditions['game_id'] = ['in', $gameIds]; if ($serverId > 0) { $conditions['server_id'] = $serverId; } + $conditions[$params['time_column']] = ['between', [$beginTime, $endTime]]; return $conditions; }