移除collectReward collectDoubleReward
This commit is contained in:
parent
01d8bd21d4
commit
a9d8303118
22
doc/Role.py
22
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',
|
||||
|
@ -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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user