|
@@ -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 = "余额不足"
|