xuzhiheng 4 năm trước cách đây
mục cha
commit
16dc6a51f4
1 tập tin đã thay đổi với 5 bổ sung10 xóa
  1. 5 10
      utils/cost_by_account_balance.go

+ 5 - 10
utils/cost_by_account_balance.go

@@ -38,17 +38,12 @@ func costByAccountBalance(getData func() ([]map[string]interface{}, int, error),
 	beforeJudge, payMoney := beforeCheck(productType, product.UnitPrice, len(data), userProduct)
 	if beforeJudge {
 		global.Logger.Info("交易金额", zap.Any("payMoney:", payMoney))
-		if err != nil {
-			errStr = "内部错误"
-			global.Logger.Error("数据库操作失败", getUserProductError(appID, productID, err)...)
+		datas = data
+		if len(datas) == 0 {
+			global.Logger.Info("无数据", getUserProductError(appID, productID, err)...)
+			orderCode, err = afterCheck(len(data), payMoney, userProduct, statusCode, param, ip)
 		} else {
-			datas = data
-			if len(datas) == 0 {
-				global.Logger.Info("无数据", getUserProductError(appID, productID, err)...)
-				orderCode, err = afterCheck(len(data), payMoney, userProduct, statusCode, param, ip)
-			} else {
-				orderCode, err = afterCheck(len(data), payMoney, userProduct, statusCode, param, ip)
-			}
+			orderCode, err = afterCheck(len(data), payMoney, userProduct, statusCode, param, ip)
 		}
 	} else {
 		errStr = "余额不足"