From 5021a44067f87f82df90b4f3985aa8cae0a597ea Mon Sep 17 00:00:00 2001 From: hujiabin Date: Fri, 23 Sep 2022 19:47:17 +0800 Subject: [PATCH] 1 --- webapp/controller/ChipController.class.php | 37 +++------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/webapp/controller/ChipController.class.php b/webapp/controller/ChipController.class.php index fb9f39be..a62d5ccc 100644 --- a/webapp/controller/ChipController.class.php +++ b/webapp/controller/ChipController.class.php @@ -334,10 +334,10 @@ class ChipController extends BaseAuthedController public function syntheticChip(){ $token_id_main = trim(getReqVal('token_id_main', 0)); $token_id_param = array_filter(explode(' ',getReqVal('token_id_param', 0))); -// if (! $token_id_main || count($token_id_param)<=0 ) { -// $this->_rspErr(1, 'Please enter instructions token_id_param'); -// return; -// } + if (! $token_id_main || count($token_id_param)<=0 ) { + $this->_rspErr(1, 'Please enter instructions token_id_param'); + return; + } $chip_main = Chip::getChipByTokenId($token_id_main); $upgrade_cost = \services\FormulaService::getChipUpgradeCost($chip_main['chip_grade']+1); if ($upgrade_cost==0){ @@ -350,36 +350,7 @@ class ChipController extends BaseAuthedController $cumulative_cost += \services\FormulaService::getChipCumulativeCost($chip_param['chip_grade']); Chip::deleteChip(['token_id'=>$val]); } - $num = round(round(($cumulative_cost/$upgrade_cost),5)*10000); -// $a = rand(1,10000); -// if ($num_rspData([ -// 'state' => 0, -// 'data' => [ -// 'main'=>$token_id_main, -// 'param'=>$token_id_param, -// 'main_cost'=>$upgrade_cost, -// 'param_cost'=>$cumulative_cost, -// 'num'=>$num, -//// 'rand'=>$a -// ], -// ]); -// return; -// }else{ -// $this->_rspData([ -// 'state' => 1, -// 'data' => [ -// 'main'=>$token_id_main, -// 'param'=>$token_id_param, -// 'main_cost'=>$upgrade_cost, -// 'param_cost'=>$cumulative_cost, -// 'num'=>$num, -// 'rand'=>$a -// ], -// ]); -// return; -// } $propertyChgService = new services\PropertyChgService(); $propertyChgService->addChip(); if ($num