|
|
@@ -66,10 +66,6 @@ class xhPayToolService
|
|
|
$connection = Yii::$app->db;//事务处理
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
-
|
|
|
- //使用优惠券
|
|
|
- CouponClass::useCoupon($couponId);
|
|
|
-
|
|
|
$typeList = configDict::getConfig('capitalType');//流水类型列表
|
|
|
switch ($capitalType) {
|
|
|
case $typeList['xhOrder']['id']://购买商品
|
|
|
@@ -125,9 +121,13 @@ class xhPayToolService
|
|
|
}
|
|
|
if (empty($userId) && $payWay == $balancePay) {
|
|
|
$transaction->rollBack();
|
|
|
- Yii::warning('未登陆用户无法使用余额支付,capitalType:' . $capitalType . ' orderSn:' . $orderSn);
|
|
|
+ Yii::warning('未登陆不能使用余额支付,capitalType:' . $capitalType . ' orderSn:' . $orderSn);
|
|
|
util::fail('没有登陆不能使用余额支付');
|
|
|
}
|
|
|
+
|
|
|
+ //使用优惠券
|
|
|
+ CouponClass::useCoupon($couponId, $orderId);
|
|
|
+
|
|
|
$updateData = [];
|
|
|
$updateData['alipayId'] = $alipayId;
|
|
|
//支付宝支付
|
|
|
@@ -168,7 +168,7 @@ class xhPayToolService
|
|
|
//支付方式要转到商家资产变更里去
|
|
|
$order['payWay'] = $payWay;
|
|
|
xhMerchantAssetService::incomeChangeAsset($merchant, $mAsset, $shopId, $mUpdateData, $order, $capitalType);//商家资产改变
|
|
|
-
|
|
|
+
|
|
|
$userName = isset($user['userName']) ? $user['userName'] : '游客';
|
|
|
switch ($capitalType) {
|
|
|
case $typeList['xhOrder']['id']://购买商品
|