|
|
@@ -182,7 +182,7 @@ class xhPayToolService
|
|
|
default:
|
|
|
}
|
|
|
$capitalData = [
|
|
|
- 'relateId' => (string)$orderSn,
|
|
|
+ 'relateId' => $orderId,
|
|
|
'balance' => $mBalance,
|
|
|
'totalIncome' => $mIncome,
|
|
|
'totalExpend' => $mExpend,
|
|
|
@@ -208,16 +208,16 @@ class xhPayToolService
|
|
|
$updateData['payTime'] = $now;
|
|
|
switch ($capitalType) {
|
|
|
case $typeList['xhOrder']['id']://购买商品
|
|
|
- xhOrderService::updateById($orderSn, $updateData);
|
|
|
+ xhOrderService::updateById($orderId, $updateData);
|
|
|
//发货里的下单流程完成
|
|
|
OrderSendClass::placeOrder(['orderId' => $orderId, 'payTime' => $now]);
|
|
|
break;
|
|
|
case $typeList['xhActiveOrder']['id']://活动报名
|
|
|
- xhActiveOrderService::updateById($orderSn, $updateData);
|
|
|
+ xhActiveOrderService::updateById($orderId, $updateData);
|
|
|
break;
|
|
|
case $typeList['xhApplyOrder']['id']://申请服务
|
|
|
$updateData['inviteCodeStatus'] = 1;
|
|
|
- xhApplyOrderService::updateById($orderSn, $updateData);
|
|
|
+ xhApplyOrderService::updateById($orderId, $updateData);
|
|
|
break;
|
|
|
default:
|
|
|
Yii::warning('更新订单失败,回调传过来的 capitalType 不符合要求,即订单流水类型不明确,capitalType:' . $capitalType . ' orderSn:' . $orderSn);
|
|
|
@@ -238,11 +238,11 @@ class xhPayToolService
|
|
|
$upAssetData['totalBuyNum'] = $userTotalBuyNum;
|
|
|
xhUserAssetService::ioChangeAsset($user, $userAsset, $upAssetData, $merchant, $merchantExtend, $order, $capitalType);//用户资产改变
|
|
|
|
|
|
- $integralData = [
|
|
|
+ $growData = [
|
|
|
'userId' => $userId,
|
|
|
'userName' => $userName,
|
|
|
'merchantId' => $merchantId,
|
|
|
- 'relateId' => (string)$orderSn,
|
|
|
+ 'relateId' => $orderId,
|
|
|
'growth' => $userGrowth,
|
|
|
'num' => floor($totalFee),
|
|
|
'io' => 1,
|
|
|
@@ -254,10 +254,10 @@ class xhPayToolService
|
|
|
'capitalType' => $capitalType,
|
|
|
'addTime' => $now,
|
|
|
];
|
|
|
- xhUserGrowthService::add($integralData);//用户兑换型积分流水增加
|
|
|
+ xhUserGrowthService::add($growData);//用户兑换型积分流水增加
|
|
|
|
|
|
$userCapitalData = [
|
|
|
- 'relateId' => (string)$orderSn,
|
|
|
+ 'relateId' => $orderId,
|
|
|
'balance' => $remainBalance,
|
|
|
'totalIncome' => $userAsset['totalIncome'],
|
|
|
'totalExpend' => $userTotalExpend,
|
|
|
@@ -275,14 +275,9 @@ class xhPayToolService
|
|
|
'capitalType' => $capitalType,
|
|
|
];
|
|
|
xhUserCapitalService::add($userCapitalData);//用户资金流水增加
|
|
|
-
|
|
|
+
|
|
|
$transaction->commit();
|
|
|
-
|
|
|
- //订单有选择分类和用途,则直接进行老带新的发放和资金分类登记 shish 2019.9.3
|
|
|
- if (isset($order['categoryId']) && !empty($order['categoryId']) && isset($order['usageId']) && !empty($order['usageId'])) {
|
|
|
- //$setOrderData = ['id' => $orderSn, 'categoryId' => $order['categoryId'], 'usageId' => $order['usageId']];
|
|
|
- //OrderService::setOrderStyle($setOrderData, true);
|
|
|
- }
|
|
|
+
|
|
|
} catch (Exception $e) {
|
|
|
$transaction->rollBack();
|
|
|
util::fail('支付没有成功');
|