|
@@ -76,6 +76,9 @@ class PayTemplateController extends CatchController
|
|
$option_cache = [];
|
|
$option_cache = [];
|
|
$type_list = collect($this->optionTypeList())->pluck('value');
|
|
$type_list = collect($this->optionTypeList())->pluck('value');
|
|
foreach($option_list as $option){
|
|
foreach($option_list as $option){
|
|
|
|
+ if(!is_numeric($option['price']) || !is_numeric($option['given'])){
|
|
|
|
+ ChannelBusinessException::throwError(Errors::PARAM_ERROR);
|
|
|
|
+ }
|
|
if($option['type'] == 'COIN' || $option['type'] == 'FIRST_COIN'){
|
|
if($option['type'] == 'COIN' || $option['type'] == 'FIRST_COIN'){
|
|
if($option['given'] > 3*$option['price']*100){
|
|
if($option['given'] > 3*$option['price']*100){
|
|
ChannelBusinessException::throwError(Errors::PAY_TEMPLATE_GIVEN_TOO_MUCH);
|
|
ChannelBusinessException::throwError(Errors::PAY_TEMPLATE_GIVEN_TOO_MUCH);
|
|
@@ -381,14 +384,24 @@ class PayTemplateController extends CatchController
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+ public function optionTypeListOutPut(){
|
|
|
|
+ return collect($this->optionTypeList())->map(function($item){
|
|
|
|
+ return [
|
|
|
|
+ 'type'=>$item['value'],'type_name'=>$item['name']
|
|
|
|
+ ];
|
|
|
|
+ })->all();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
public function optionSequence(){
|
|
public function optionSequence(){
|
|
return [
|
|
return [
|
|
- ['name'=>'位置一','value'=>1],
|
|
|
|
- ['name'=>'位置二','value'=>2],
|
|
|
|
- ['name'=>'位置三','value'=>3],
|
|
|
|
- ['name'=>'位置四','value'=>4],
|
|
|
|
- ['name'=>'位置五','value'=>5],
|
|
|
|
- ['name'=>'位置六','value'=>6]
|
|
|
|
|
|
+ ['sequence_text'=>'位置一','sequence'=>1],
|
|
|
|
+ ['sequence_text'=>'位置二','sequence'=>2],
|
|
|
|
+ ['sequence_text'=>'位置三','sequence'=>3],
|
|
|
|
+ ['sequence_text'=>'位置四','sequence'=>4],
|
|
|
|
+ ['sequence_text'=>'位置五','sequence'=>5],
|
|
|
|
+ ['sequence_text'=>'位置六','sequence'=>6]
|
|
];
|
|
];
|
|
}
|
|
}
|
|
}
|
|
}
|