Explorar o código

bugfix: EK-1569: 报单时无法使用PayStack支付.

kevinElken hai 8 meses
pai
achega
d0abffc889

+ 0 - 1
common/models/forms/ApproachDeclarationLoopForm.php

@@ -59,7 +59,6 @@ class ApproachDeclarationLoopForm extends Model
      * @param $attribute
      */
     public function formatData($attribute){
-        //$this->data = Json::decode($this->data);
         if(!is_array($this->data)){
             $this->addError($attribute, 'Data format error');// 数据格式错误
         }

+ 2 - 17
common/models/forms/ApproachReconsumeOrderForm.php

@@ -571,20 +571,6 @@ class ApproachReconsumeOrderForm extends Model
                 }
             }
 
-            if ($this->payType == 'prp') {
-                //看余额是否充足
-                $decCash = UserPerformance::getAmounts($loginUserId);
-            } else {
-                //看现金余额是否充足
-                $decCash = Cash::getAvailableBalance($loginUserId);
-            }
-
-            // 转换后的余额
-            $localCash = Tool::convertAmount($decCash, $decUserCurrencyRate, $currencyRate);
-            if ($localCash < $this->_decAmount){
-                throw new Exception(Yii::t('app', 'applicantPrpShort'), 400);
-            }
-
             foreach ($this->goodsNum as $k => $v){
                 if ($v){
                     $goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
@@ -603,14 +589,13 @@ class ApproachReconsumeOrderForm extends Model
                             $data->update();
 
                         }
-                    }else{
+                    } else {
                         throw new Exception($goods['GOODS_NAME'] . Yii::t('app', 'insufficientInventory'));
-
                     }
                 }
             }
 
-            //写入订单
+            // 写入订单
             if (!$orderResult = $this->addOrder()) {
                 throw new Exception(Form::formatErrorsForApi($orderResult->getErrors()));
             }