|
@@ -376,7 +376,7 @@ class StoreOrder extends BaseModel
|
|
|
|
|
|
//积分抵扣
|
|
|
$res2 = true;
|
|
|
- $SurplusIntegral = $userInfo['integral'];
|
|
|
+ $SurplusIntegral = $userInfo['voucher'];
|
|
|
if ($payIntegral > 0) {
|
|
|
if ($userInfo['integral'] < $payIntegral) {
|
|
|
return self::setErrorInfo('积分不足', true);
|
|
@@ -394,20 +394,20 @@ class StoreOrder extends BaseModel
|
|
|
$payPrice = bcsub($payPrice, $deductionPrice, 2);
|
|
|
$usedIntegral = $SurplusIntegral;
|
|
|
$SurplusIntegral = 0;
|
|
|
- $res2 = false !== User::edit(['integral' => 0], $userInfo['uid'], 'uid');
|
|
|
+ $res2 = false !== User::edit(['voucher' => 0], $userInfo['uid'], 'uid');
|
|
|
} else {
|
|
|
$deductionPrice = $payPrice;
|
|
|
$usedIntegral = (float)bcdiv($payPrice, $other['integralRatio'], 2);
|
|
|
$SurplusIntegral = bcsub($SurplusIntegral, $usedIntegral, 2);
|
|
|
- $res2 = false !== User::bcDec($userInfo['uid'], 'integral', $usedIntegral, 'uid');
|
|
|
+ $res2 = false !== User::bcDec($userInfo['uid'], 'voucher', $usedIntegral, 'uid');
|
|
|
$payPrice = 0;
|
|
|
}
|
|
|
- $res2 = $res2 && false != UserBill::expend('积分抵扣', $uid, 'integral', 'deduction', $usedIntegral, $key, $SurplusIntegral, '购买商品使用' . floatval($usedIntegral) . '积分抵扣' . floatval($deductionPrice) . '元');
|
|
|
+ $res2 = $res2 && false != UserBill::expend('抵扣券抵扣', $uid, 'voucher', 'sub_voucher', $usedIntegral, $key, $SurplusIntegral, '购买商品使用' . floatval($usedIntegral) . '抵用券抵扣' . floatval($deductionPrice) . '元');
|
|
|
} else {
|
|
|
$deductionPrice = 0;
|
|
|
$usedIntegral = 0;
|
|
|
}
|
|
|
- if (!$res2) return self::setErrorInfo('使用积分抵扣失败!', true);
|
|
|
+ if (!$res2) return self::setErrorInfo('使用抵扣券抵扣失败!', true);
|
|
|
if ($payPrice <= 0) $payPrice = 0;
|
|
|
if ($test) {
|
|
|
self::rollbackTrans();
|
|
@@ -438,7 +438,8 @@ class StoreOrder extends BaseModel
|
|
|
'deduction_price' => $deductionPrice,
|
|
|
'paid' => 0,
|
|
|
'pay_type' => $payType,
|
|
|
- 'use_integral' => $usedIntegral + $payIntegral,
|
|
|
+ 'use_integral' => 0,
|
|
|
+ 'voucher' => $usedIntegral + $payIntegral,
|
|
|
'gain_integral' => $gainIntegral,
|
|
|
'mark' => htmlspecialchars($mark),
|
|
|
'combination_id' => $combinationId,
|