From a9d8303118d0dc01dfab028c77b9508e2f38df9a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 22 Nov 2021 19:17:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4collectReward=20collectDouble?= =?UTF-8?q?Reward?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/Role.py | 22 ------- webapp/controller/RoleController.class.php | 77 ---------------------- 2 files changed, 99 deletions(-) diff --git a/doc/Role.py b/doc/Role.py index 6cd29668..2ba002c8 100644 --- a/doc/Role.py +++ b/doc/Role.py @@ -51,28 +51,6 @@ class Role(object): _common.RspHead(), ] }, - { - 'desc': 'collectReward', - 'group': 'Role', - 'url': 'webapp/index.php?c=Role&a=collectReward', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - { - 'desc': 'collectDoubleReward', - 'group': 'Role', - 'url': 'webapp/index.php?c=Role&a=collectDoubleReward', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, { 'desc': 'getPreSettlementInfo', 'group': 'Role', diff --git a/webapp/controller/RoleController.class.php b/webapp/controller/RoleController.class.php index 9b32b3c6..18f4210c 100644 --- a/webapp/controller/RoleController.class.php +++ b/webapp/controller/RoleController.class.php @@ -414,83 +414,6 @@ class RoleController extends BaseAuthedController { )); } - public function collectReward() - { - $account_id = $_REQUEST['account_id']; - $conn = $this->getMysql($account_id); - $record_list = array(); - $ret = $conn->execScript('UPDATE user SET collect_status=1, modify_time=:modify_time ' . - ' WHERE accountid=:accountid;', - array( - ':modify_time' => phpcommon\getNowTime(), - ':accountid' => $account_id - )); - if (!$ret) { - die(); - return; - } - $d = mt\Drop::getOldDrop(24003); - if (!$d) { - phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); - return; - } - $item_id_array = $this->getExplode($d['item_id']); - $num_array = $this->getExplode($d['num']); - $weight_array = $this->getExplode($d['weight']); - $i = 0; - $item_list = array(); - foreach ($weight_array as $item) { - if ($item[0] >= Rand(0, 10000)) { - $item_id = $item_id_array[$i][0]; - $item_num = $num_array[$i][0]; - $addreward = new classes\AddReward(); - $addreward->addReward($item_id, $item_num, $account_id); - array_push($item_list, array( - 'item_id' => $item_id, - 'item_num' => $item_num - )); - } - $i++; - } - echo json_encode(array( - 'errcode' => 0, - 'errmsg' => '', - 'item_list' => $item_list - )); - } - - public function collectDoubleReward() - { - $account_id = $_REQUEST['account_id']; - $conn = $this->getMysql($account_id); - $record_list = array(); - $d = mt\Drop::getOldDrop(24003); - if (!$d) { - phpcommon\sendError(ERR_USER_BASE + 3, '没有这个奖励'); - return; - } - $item_id_array = $this->getExplode($d['item_id']); - $num_array = $this->getExplode($d['num']); - $weight_array = $this->getExplode($d['weight']); - $i = 0; - $item_list = array(); - $p = mt\Parameter::getOldParam(REWARD_TIMES); - $times = $p['param_value'] - 1; - foreach ($weight_array as $item) { - if ($item[0] >= Rand(0, 10000)) { - $item_id = $item_id_array[$i][0]; - $item_num = $num_array[$i][0]; - $addreward = new classes\AddReward(); - $addreward->addReward($item_id, $item_num * $times, $account_id); - } - $i++; - } - echo json_encode(array( - 'errcode' => 0, - 'errmsg' => '', - )); - } - public function getPreSettlementInfo() { $account_id = $_REQUEST['account_id'];