shish 6 سال پیش
والد
کامیت
ee0d2bee96
2فایلهای تغییر یافته به همراه17 افزوده شده و 17 حذف شده
  1. 4 4
      common/services/xhRechargeService.php
  2. 13 13
      common/services/xhUserAssetService.php

+ 4 - 4
common/services/xhRechargeService.php

@@ -149,8 +149,8 @@ class xhRechargeService
 			$typeList = configDict::getConfig('capitalType');//流水类型列表
 			$capitalType = $typeList['xhRecharge']['id'];//流水类型为充值订单
 			$userAsset = xhUserAssetService::getByUserId($userId);
-			$gainIntegral = floor($rechargeAmount);//去掉小数点部分
-			$totalIntegral = stringUtil::calcAdd($userAsset['integral'], $gainIntegral);
+			$gainGrowth = floor($rechargeAmount);//去掉小数点部分
+			$totalGrowth = stringUtil::calcAdd($userAsset['growth'], $gainGrowth);
 			$totalBalance = stringUtil::calcAdd($userAsset['balance'], $rechargeAmount);
 			$totalRecharge = stringUtil::calcAdd($userAsset['totalRecharge'], $rechargeAmount);
 			$merchantTotalRecharge = stringUtil::calcAdd($merchantAsset['totalRecharge'], $rechargeAmount);
@@ -171,7 +171,7 @@ class xhRechargeService
 			];
 			$order = self::add($rechargeData);//用户充值记录增加
 			
-			$upData['integral'] = $totalIntegral;
+			$upData['growth'] = $totalGrowth;
 			$upData['balance'] = $totalBalance;
 			$upData['totalRecharge'] = $totalRecharge;
 			xhUserAssetService::ioChangeAsset($user, $userAsset, $upData, $merchant, $merchantExtend, $order, $capitalType);//用户资产变化
@@ -189,7 +189,7 @@ class xhRechargeService
 				'merchantId' => $merchantId,
 				'relateId' => (string)$order['id'],
 				'integral' => $totalIntegral,
-				'num' => $gainIntegral,
+				'num' => $gainGrowth,
 				'io' => 1,
 				'payWay' => $payWay,
 				'event' => "现金充值 {$rechargeAmount}元",

+ 13 - 13
common/services/xhUserAssetService.php

@@ -44,15 +44,15 @@ class xhUserAssetService
 		$merchantId = $merchant['id'];
 		$orderId = $order['id'];
 		$openId = $user['openId'];
-		$integral = isset($upAssetData['integral']) ? $upAssetData['integral'] : 0;
+		$growth = isset($upAssetData['growth']) ? $upAssetData['growth'] : 0;
 		$preLevel = $userAsset['member'];
-		$preIntegral = $userAsset['integral'];
-		$addIntegral = stringUtil::calcSub($integral, $preIntegral);
-		
+		$preGrowth = $userAsset['growth'];
+		$addGrowth = stringUtil::calcSub($growth, $preGrowth);
+
 		$allTM = xhTMessageService::getList($merchantId);
-		
-		//没有积分,后续升级流程不需要再走
-		if (empty($integral)) {
+
+		//没有成长值,后续升级流程不需要再走
+		if (empty($growth)) {
 			self::updateByUserId($userId, $upAssetData);
 			return;
 		}
@@ -84,19 +84,19 @@ class xhUserAssetService
 					}
 					
 				} else {
-					if ($addIntegral > 0) {
+					if ($addGrowth > 0) {
 						$shortTempId = 'TM00230';
 						$tempId = isset($allTM[$shortTempId]) ? $allTM[$shortTempId] : 0;
 						if (!empty($tempId)) {
 							$changeData = ["touser" => $openId, "template_id" => $tempId,
 								"url" => Yii::$app->params['frontUrl'] . "/center/order-detail?id=$orderId&account=" . $merchant['id'],
 								"data" => [
-									"first" => ["value" => "您在本店购物获得积分", "color" => "#173177"],
+									"first" => ["value" => "您在本店购物获得成长值", "color" => "#173177"],
 									"FieldName" => ["value" => "会员名称", "color" => "#0F0F0F"],
 									"Account" => ["value" => $user['userName'], "color" => "#173177"],
 									"change" => ["value" => "增加", "color" => "#0F0F0F"],
-									"CreditChange" => ["value" => $addIntegral, "color" => "#173177"],
-									"CreditTotal" => ["value" => $integral, "color" => "#173177"],
+									"CreditChange" => ["value" => $addGrowth, "color" => "#173177"],
+									"CreditTotal" => ["value" => $growth, "color" => "#173177"],
 									"Remark" => ["value" => "点此查看订单明细、添加编辑收花人信息", "color" => "#173177"],],];
 							wxUtil::sendTaskInform($changeData, $merchant);
 						}
@@ -157,7 +157,7 @@ class xhUserAssetService
 								"Account" => ["value" => $user['userName'], "color" => "#173177"],
 								"change" => ["value" => "增加", "color" => "#0F0F0F"],
 								"CreditChange" => ["value" => $addIntegral, "color" => "#173177"],
-								"CreditTotal" => ["value" => $integral, "color" => "#173177"],
+								"CreditTotal" => ["value" => $growth, "color" => "#173177"],
 								"Remark" => ["value" => "点此查看明细!", "color" => "#173177"],],];
 						wxUtil::sendTaskInform($changeData, $merchant);
 					}
@@ -168,7 +168,7 @@ class xhUserAssetService
 			
 		}
 		//新增积分
-		UserIntegralService::increaseToUpgrade($preIntegral, $integral, $preLevel, $userId, $merchantId, $merchantExtend);
+		UserIntegralService::increaseToUpgrade($preGrowth, $growth, $preLevel, $userId, $merchantId, $merchantExtend);
 		
 		self::updateByUserId($userId, $upAssetData);
 	}