|
|
@@ -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()));
|
|
|
}
|