1
This commit is contained in:
parent
b73889cacf
commit
5fe36c8bc7
16
doc/Role.py
16
doc/Role.py
@ -136,25 +136,17 @@ class Role(object):
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'desc': 'updateDailyAD',
|
'desc': '获取战斗装备(该函数存在刷道具风险)getFightEquip',
|
||||||
'group': 'Role',
|
|
||||||
'url': 'webapp/index.php?c=Role&a=updateDailyAD',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'desc': 'getFightEquip',
|
|
||||||
'group': 'Role',
|
'group': 'Role',
|
||||||
'url': 'webapp/index.php?c=Role&a=getFightEquip',
|
'url': 'webapp/index.php?c=Role&a=getFightEquip',
|
||||||
'params': [
|
'params': [
|
||||||
_common.ReqHead(),
|
_common.ReqHead(),
|
||||||
|
['id', 0, 'id'],
|
||||||
],
|
],
|
||||||
'response': [
|
'response': [
|
||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
|
['!item_list', _common.DropItemInfo, '掉落道具列表'],
|
||||||
|
['!all_item_list', _common.RewardItemInfo, '实际奖励的道具列表'],
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -520,9 +520,10 @@ class RoleController extends BaseAuthedController {
|
|||||||
|
|
||||||
public function getFightEquip()
|
public function getFightEquip()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$equip1 = mt\Parameter::getVal('opening_spear', 0);
|
||||||
|
$equip2 = mt\Parameter::getVal('opening_spear2', 0);
|
||||||
|
|
||||||
$id = $_REQUEST['id'];
|
$id = $_REQUEST['id'];
|
||||||
$conn = $this->getMysql($account_id);
|
|
||||||
$addreward = new classes\AddReward();
|
$addreward = new classes\AddReward();
|
||||||
$item_list = array();
|
$item_list = array();
|
||||||
array_push($item_list, array(
|
array_push($item_list, array(
|
||||||
@ -530,44 +531,28 @@ class RoleController extends BaseAuthedController {
|
|||||||
'item_num' => 1,
|
'item_num' => 1,
|
||||||
'time' => 0
|
'time' => 0
|
||||||
));
|
));
|
||||||
$all_item_list = $addreward->addReward($id, 1, $account_id, 0, 0);
|
$all_item_list = $addreward->addReward($id, 1, $this->getAccountId(), 0, 0);
|
||||||
$p1 = mt\Parameter::getOldParam(OPENING_SPEAR);
|
|
||||||
$equip1 = $p1['param_value'];
|
|
||||||
$p2 = mt\Parameter::getOldParam(OPENING_SPEAR2);
|
|
||||||
$equip2 = $p2['param_value'];
|
|
||||||
if ($equip1 == $id) {
|
if ($equip1 == $id) {
|
||||||
$ret = $conn->execScript('UPDATE user SET new_first_equip=1, modify_time=:modify_time ' .
|
$this->updateUserInfo(array(
|
||||||
' WHERE accountid=:accountid;',
|
'new_first_equip' => 1,
|
||||||
array(
|
'modify_time' => $this->getNowTime(),
|
||||||
':accountid' => $account_id,
|
));
|
||||||
':modify_time' => phpcommon\getNowTime(),
|
phpcommon\SqlHelper::update
|
||||||
));
|
($this->getSelfMysql(),
|
||||||
if (!$ret) {
|
'equip',
|
||||||
die();
|
array(
|
||||||
return;
|
'accountid' => $this->getAccountId(),
|
||||||
}
|
),
|
||||||
$ret = $conn->execScript('UPDATE equip SET using_id=:using_id, modify_time=:modify_time ' .
|
array(
|
||||||
' WHERE accountid=:accountid;',
|
'using_id' => $id,
|
||||||
array(
|
'modify_time' => $this->getNowTime(),
|
||||||
':accountid' => $account_id,
|
)
|
||||||
':using_id' => $id,
|
);
|
||||||
':modify_time' => phpcommon\getNowTime(),
|
|
||||||
));
|
|
||||||
if (!$ret) {
|
|
||||||
die();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else if ($equip2 == $id) {
|
} else if ($equip2 == $id) {
|
||||||
$ret = $conn->execScript('UPDATE user SET new_second_equip=1, modify_time=:modify_time ' .
|
$this->updateUserInfo(array(
|
||||||
' WHERE accountid=:accountid;',
|
'new_second_equip' => 1,
|
||||||
array(
|
'modify_time' => $this->getNowTime(),
|
||||||
':accountid' => $account_id,
|
));
|
||||||
':modify_time' => phpcommon\getNowTime(),
|
|
||||||
));
|
|
||||||
if (!$ret) {
|
|
||||||
die();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user