1
This commit is contained in:
parent
20aaec0787
commit
ad004bb043
@ -350,16 +350,36 @@ class ChipController extends BaseAuthedController
|
|||||||
$cumulative_cost += \services\FormulaService::getChipCumulativeCost($chip_param['chip_grade']);
|
$cumulative_cost += \services\FormulaService::getChipCumulativeCost($chip_param['chip_grade']);
|
||||||
// Chip::deleteChip(['token_id'=>$val]);
|
// Chip::deleteChip(['token_id'=>$val]);
|
||||||
}
|
}
|
||||||
$this->_rspData([
|
|
||||||
'state' => 0,
|
|
||||||
'data' => [
|
|
||||||
'main'=>$token_id_main,
|
|
||||||
'param'=>$token_id_param,
|
|
||||||
'main_cost'=>$upgrade_cost,
|
|
||||||
'param_cost'=>$cumulative_cost,
|
|
||||||
],
|
|
||||||
]);return;
|
|
||||||
$num = round(round(($cumulative_cost/$upgrade_cost),5)*10000);
|
$num = round(round(($cumulative_cost/$upgrade_cost),5)*10000);
|
||||||
|
$a = rand(1,10000);
|
||||||
|
if ($num<$a){
|
||||||
|
$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 = new services\PropertyChgService();
|
||||||
$propertyChgService->addChip();
|
$propertyChgService->addChip();
|
||||||
if ($num<rand(1,10000)){ echo 'NO';die;
|
if ($num<rand(1,10000)){ echo 'NO';die;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user