From 71e02a4add2826f6430a5996513519b5ceee2ec0 Mon Sep 17 00:00:00 2001 From: chenxiaojun <956334972@qq.com> Date: Tue, 14 Jan 2020 17:03:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E7=AE=A1=E7=90=86--=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Model/WithdrawModel.class.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Application/Admin/Model/WithdrawModel.class.php b/Application/Admin/Model/WithdrawModel.class.php index e01e83bc1..dbd374981 100644 --- a/Application/Admin/Model/WithdrawModel.class.php +++ b/Application/Admin/Model/WithdrawModel.class.php @@ -269,14 +269,14 @@ class WithdrawModel extends Model{ $notInGameIds = [-1]; foreach ($promoteGameRatios as $promoteGameRatio) { if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) { + $ratio = $promoteGameRatio['ratio']; + $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); + $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true); if (!empty($gameIds)) { foreach ($gameIds as $gameId) { $spendWhere['game_id'] = $gameId; $notInGameIds[] = $gameId; - $ratio = $promoteGameRatio['ratio']; - $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); - $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount") ->where($spendWhere) ->find()['sum_amount']; @@ -396,12 +396,12 @@ class WithdrawModel extends Model{ $gameRatios = []; foreach ($promoteGameRatios as $promoteGameRatio) { if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) { + $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); + $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true); if (!empty($gameIds)) { foreach ($gameIds as $gameId) { - $spendWhere['game_id'] = $gameId; - $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); - $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); + $spendMap['game_id'] = $gameId; $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount") ->where($spendMap) ->find()['sum_amount']; @@ -487,12 +487,12 @@ class WithdrawModel extends Model{ $balance = 0; foreach ($promoteGameRatios as $promoteGameRatio) { if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) { + $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); + $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true); if (!empty($gameIds)) { foreach ($gameIds as $gameId) { $spendMap['game_id'] = $gameId; - $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); - $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount") ->where($spendMap) ->find()['sum_amount']; @@ -548,14 +548,14 @@ class WithdrawModel extends Model{ $notInGameIds = [-1]; foreach ($promoteGameRatios as $promoteGameRatio) { if (!empty($promoteGameRatio['turnover_ratio']) && $promoteGameRatio['begin_time'] <= $settlementBeginTime && (empty($promoteGameRatio['end_time']) || $promoteGameRatio['end_time'] >= $settlementEndTime)) { + $ratio = $promoteGameRatio['ratio']; + $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); + $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $gameIds = D('game')->where(array('relation_game_id' => $promoteGameRatio['game_id']))->getField('id', true); if (!empty($gameIds)) { foreach ($gameIds as $gameId) { $spendWhere['game_id'] = $gameId; $notInGameIds[] = $gameId; - $ratio = $promoteGameRatio['ratio']; - $promoteGameRatio['turnover_ratio'] = json_decode($promoteGameRatio['turnover_ratio'], true); - $turnoverRatios = array_reverse($promoteGameRatio['turnover_ratio']); $sumAmount = $spendModel->field("sum(pay_amount) as sum_amount") ->where($spendWhere) ->find()['sum_amount'];