From b36fabac194db3c54e6e53d17f03b4c55c577f9c Mon Sep 17 00:00:00 2001 From: wangwei01 Date: Tue, 25 Jun 2019 10:59:52 +0800 Subject: [PATCH] 1 --- webapp/controller/HangController.class.php | 7 ++----- webapp/controller/RoleController.class.php | 9 +++------ 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/webapp/controller/HangController.class.php b/webapp/controller/HangController.class.php index b920a79..9e4f2dc 100644 --- a/webapp/controller/HangController.class.php +++ b/webapp/controller/HangController.class.php @@ -151,12 +151,9 @@ class HangController{ $g_conf_reward_cluster = require('../res/rewardTimes@rewardTimes.php'); $times = 1; $reward_conf = array(); - for ($i = 0; $i <= count($g_conf_reward_cluster); $i++) { - $reward_id = $g_conf_reward_cluster[$i + 91000]['id']; + for ($i = 0; $i < 4; $i++) { + $reward_id = $i + 91000; $reward_conf = getRewardTimesConfig($g_conf_reward_cluster, $reward_id); - if ($reward_conf['typeId'] != 1) { - continue; - } if ((int)$coin_num >= $reward_conf['minGold'] && (int)$coin_num <= $reward_conf['maxGold']) { $times = $reward_conf['times']; break; diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 20235db..bdc3407 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -419,7 +419,7 @@ class RoleController{ return; } $coin_num = $row['coin']; - $times = $this->getRewardTimes($num); + $times = $this->getRewardTimes($coin_num); $coin_num = $row['coin'] * ($times - 1); $rowUser = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', array( @@ -447,12 +447,9 @@ class RoleController{ $g_conf_reward_cluster = require('../res/rewardTimes@rewardTimes.php'); $times = 1; $reward_conf = array(); - for ($i = 0; $i <= count($g_conf_reward_cluster); $i++) { - $reward_id = $g_conf_reward_cluster[$i + 91100]['id']; + for ($i = 0; $i < 4; $i++) { + $reward_id = $i + 91100; $reward_conf = getRewardTimesConfig($g_conf_reward_cluster, $reward_id); - if ($reward_conf['typeId'] != 1) { - continue; - } if ((int)$coin_num >= $reward_conf['minGold'] && (int)$coin_num <= $reward_conf['maxGold']) { $times = $reward_conf['times']; break;