1
This commit is contained in:
parent
45aab549c7
commit
5021a44067
@ -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<rand(1,10000)){
|
||||
// $this->_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<rand(1,10000)){
|
||||
|
Loading…
x
Reference in New Issue
Block a user