WIN-2308041133\Administrator hai 3 semanas
pai
achega
f93c803145
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      app/models/store/StoreOrder.php

+ 12 - 1
app/models/store/StoreOrder.php

@@ -423,7 +423,18 @@ class StoreOrder extends BaseModel
 //                $usedIntegral = 0;
 //            }
 //            if (!$res2) return self::setErrorInfo('使用积分抵扣失败!', true);
-            $SurplusIntegral = $userInfo['integral'];
+
+            $res2 = true;
+            $SurplusIntegral = $userInfo['brokerage_price'];
+//            if ($payIntegral > 0) {
+//                if ($userInfo['integral'] < $payIntegral) {
+//                    return self::setErrorInfo('积分不足', true);
+//                } else {
+//                    $res2 = false !== User::bcDec($userInfo['uid'], 'integral', $payIntegral, 'uid');
+//                }
+//                $SurplusIntegral = bcsub($userInfo['integral'], $payIntegral, 2);
+//                $res2 = $res2 && false != UserBill::expend('积分商品', $uid, 'integral', 'integral_product', $payIntegral, $key, $SurplusIntegral, '购买积分商品使用' . $payIntegral . '积分');
+//            }
             //奖金抵扣
             if ($useIntegral && $SurplusIntegral > 0) {
                 $deductionPrice = (float)bcmul($SurplusIntegral, $other['integralRatio'], 2);