1
This commit is contained in:
parent
156d2f02e6
commit
67eb39c4e4
@ -288,31 +288,8 @@ class PassController extends BaseAuthedController
|
|||||||
public function buyLevel()
|
public function buyLevel()
|
||||||
{
|
{
|
||||||
error_log("buyLevel : " . json_encode($_REQUEST));
|
error_log("buyLevel : " . json_encode($_REQUEST));
|
||||||
// if (!$this->_isValidAddress()) {
|
$exp = getReqVal('exp', '');
|
||||||
// $this->_rspErr(1, 'address is empty');
|
$celPrice = $exp * \mt\Parameter::getVal('battlepass_buy_lv_price', '');
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
$level = getReqVal('level', '');
|
|
||||||
// $price = getReqVal('price', '');
|
|
||||||
$passMeta = \mt\BattlePass::find($level);
|
|
||||||
if (!$passMeta || $this->userInfo['level'] > $level ) {
|
|
||||||
$this->_rspErr(1, 'param level error or null');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$celPrice = ($passMeta['total_exp'] - $this->userInfo['exp']) * \mt\Parameter::getVal('battlepass_buy_lv_price', '');
|
|
||||||
// if ($celPrice != $price) {
|
|
||||||
// $this->_rspErr(1, 'The price is wrong');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// $response = services\BlockChainService::gameItemMallBuy(
|
|
||||||
// Transaction::BUY_EXP_ACTION_TYPE, services\BlockChainService::formatCurrency($price), V_ITEM_EXP, $passMeta['total_exp'] - $this->userInfo['exp']);
|
|
||||||
// $this->_setV(TN_DAILY_BUY_LEVEL_STATE, 0, 1);
|
|
||||||
// BcOrder::upsert($response['trans_id'], array(
|
|
||||||
// 'item_id' => V_ITEM_EXP,
|
|
||||||
// 'item_num' => $passMeta['total_exp'] - $this->userInfo['exp'],
|
|
||||||
// 'price' => $price,
|
|
||||||
// ));
|
|
||||||
|
|
||||||
//校验用户钻石数量
|
//校验用户钻石数量
|
||||||
$costItems = array(
|
$costItems = array(
|
||||||
array(
|
array(
|
||||||
@ -327,14 +304,15 @@ class PassController extends BaseAuthedController
|
|||||||
}
|
}
|
||||||
$this->_decItems($costItems);
|
$this->_decItems($costItems);
|
||||||
//提升通行证等级
|
//提升通行证等级
|
||||||
User::update(array(
|
$items = array(
|
||||||
'exp' => $passMeta['total_exp'],
|
array(
|
||||||
'level' => $level,
|
'item_id' => V_ITEM_EXP,
|
||||||
));
|
'item_num' => $exp
|
||||||
$this->userInfo = $this->_safeGetOrmUserInfo();
|
)
|
||||||
//解锁至相应等级的奖励
|
);
|
||||||
$this->_updatePassData();
|
|
||||||
$propertyChgService = new services\PropertyChgService();
|
$propertyChgService = new services\PropertyChgService();
|
||||||
|
$awardService = new services\AwardService();
|
||||||
|
$this->_addItems($items,$awardService,$propertyChgService);
|
||||||
$propertyChgService->addUserChg();
|
$propertyChgService->addUserChg();
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'property_chg' => $propertyChgService->toDto(),
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user