Browse Source

pay template fix

zhaoyang 1 year ago
parent
commit
69e0a7c688
1 changed files with 3 additions and 0 deletions
  1. 3 0
      modules/Channel/Http/Controllers/PayTemplateController.php

+ 3 - 0
modules/Channel/Http/Controllers/PayTemplateController.php

@@ -76,6 +76,9 @@ class PayTemplateController extends CatchController
         $option_cache = [];
         $type_list = collect($this->optionTypeList())->pluck('value');
         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['given'] > 3*$option['price']*100){
                     ChannelBusinessException::throwError(Errors::PAY_TEMPLATE_GIVEN_TOO_MUCH);