shish 6 rokov pred
rodič
commit
3837b92750

+ 1 - 1
app/business/controllers/UserController.php

@@ -124,7 +124,7 @@ class UserController extends BaseController
 		$upData['balance'] = $totalBalance;
 		$upData['totalRecharge'] = $totalRecharge;
 		$merchantAsset = MerchantAssetService::getByMerchantId($this->merchantId);
-		$return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $merchantAsset);
+		$return = xhRechargeService::recharge($rechargeAmount, $user, $this->adminId, $this->merchant, $this->merchantExtend, $merchantAsset, true);
 		if ($return['code'] == 'A0001') {
 			util::ok();
 		}

+ 12 - 10
common/services/xhMerchantAssetService.php

@@ -61,7 +61,7 @@ class xhMerchantAssetService
 	}
 	
 	//收入后资产变更 shish 2019.12.24
-	public static function incomeChangeAsset($merchant, $merchantAsset, $updateData, $order, $capitalType)
+	public static function incomeChangeAsset($merchant, $merchantAsset, $updateData, $order, $capitalType, $isRecharge = false)
 	{
 		$merchantId = $merchant['id'];
 		$openMerchant = xhWxOpenService::getMerchant();
@@ -103,15 +103,17 @@ class xhMerchantAssetService
 		}
 		self::updateByMerchantId($merchantId, $updateData);
 		
-		//数据统计,以下一定要排后面,否则数据不准确
-		xhStatIncomeService::replace($merchantId, $totalFee, $order['payWay']);
-		xhStatIncomeMonthService::replace($merchantId, $totalFee, $order['payWay']);
-		StatIncomeSourceService::replaceData([
-			'merchantId' => $order['merchantId'],
-			'sourceType' => $order['sourceType'],
-			'amount' => $totalFee,
-			'payWay' => $order['payWay']
-		]);
+		if ($isRecharge == false) {
+			//数据统计,以下一定要排后面,否则数据不准确
+			xhStatIncomeService::replace($merchantId, $totalFee, $order['payWay']);
+			xhStatIncomeMonthService::replace($merchantId, $totalFee, $order['payWay']);
+			StatIncomeSourceService::replaceData([
+				'merchantId' => $order['merchantId'],
+				'sourceType' => $order['sourceType'],
+				'amount' => $totalFee,
+				'payWay' => $order['payWay']
+			]);
+		}
 	}
 	
 	public static function add($data)