This commit is contained in:
hujiabin 2023-06-20 11:39:23 +08:00
parent b6ee6763d7
commit b4d879504e

View File

@ -184,53 +184,55 @@ class PassController extends BaseAuthedController {
)); ));
} }
// public function buyPlatinumPass(){ public function buyPlatinumPass(){
// if (empty($this->_getAddress())){ error_log("buyPlatinumPass : " . json_encode($_REQUEST));
// $this->_rspErr(1, 'address is empty'); if (!$this->_isValidAddress()){
// return; $this->_rspErr(1, 'address is empty');
// } return;
// $price = getReqVal('price', ''); }
// if ($price != \mt\Parameter::getVal('battlepass_price','')){ $price = getReqVal('price', '');
// $this->_rspErr(1, 'The price is wrong'); if ($price != \mt\Parameter::getVal('battlepass_price','')){
// return; $this->_rspErr(1, 'The price is wrong');
// } return;
// $response = services\BlockChainService::gameItemMallBuy( }
// Transaction::BUY_PASS_ACTION_TYPE,$price,V_ITEM_PASS,1); $response = services\BlockChainService::gameItemMallBuy(
// Transaction::BUY_PASS_ACTION_TYPE,$price,V_ITEM_PASS,1);
// $this->_setV(TN_DAILY_BUY_PASS_STATE, 0,1);
// BcOrder::upsert($response['trans_id'],array(
// 'item_id'=>V_ITEM_PASS,
// 'item_num'=>1,
// ));
// $this->_rspData($response);
// }
// public function buyLevel(){ $this->_setV(TN_DAILY_BUY_PASS_STATE, 0,1);
// if (empty($this->_getAddress())){ BcOrder::upsert($response['trans_id'],array(
// $this->_rspErr(1, 'address is empty'); 'item_id'=>V_ITEM_PASS,
// return; 'item_num'=>1,
// } ));
// $level = getReqVal('level', ''); $this->_rspData($response);
// $price = getReqVal('price', ''); }
// $passMeta = \mt\BattlePass::find($level);
// if (!$passMeta){ public function buyLevel(){
// $this->_rspErr(1, 'param level error or null'); error_log("buyLevel : " . json_encode($_REQUEST));
// return; if (!$this->_isValidAddress()){
// } $this->_rspErr(1, 'address is empty');
// $celPrice = ($passMeta['total_exp'] - $this->userInfo['exp']) * \mt\Parameter::getVal('battlepass_buy_lv_price',''); return;
// if ($celPrice != $price){ }
// $this->_rspErr(1, 'The price is wrong'); $level = getReqVal('level', '');
// return; $price = getReqVal('price', '');
// } $passMeta = \mt\BattlePass::find($level);
// $response = services\BlockChainService::gameItemMallBuy( if (!$passMeta){
// Transaction::BUY_EXP_ACTION_TYPE,$price,V_ITEM_EXP,$passMeta['total_exp'] - $this->userInfo['exp']); $this->_rspErr(1, 'param level error or null');
// $this->_setV(TN_DAILY_BUY_LEVEL_STATE, 0,1); return;
// BcOrder::upsert($response['trans_id'],array( }
// 'item_id'=>V_ITEM_EXP, $celPrice = ($passMeta['total_exp'] - $this->userInfo['exp']) * \mt\Parameter::getVal('battlepass_buy_lv_price','');
// 'item_num'=>$passMeta['total_exp'] - $this->userInfo['exp'], if ($celPrice != $price){
// )); $this->_rspErr(1, 'The price is wrong');
// $this->_rspData($response); return;
// } }
$response = services\BlockChainService::gameItemMallBuy(
Transaction::BUY_EXP_ACTION_TYPE,$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'],
));
$this->_rspData($response);
}
public function resetPassLevel(){ public function resetPassLevel(){