From 05b904919cd3590affd2fd54580862b41abe5c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 4 Jul 2022 15:28:50 +0800 Subject: [PATCH] 1 --- business/q_bida/q_bida_server.go | 10 ++++++---- controllers/wxpay_callback.go | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/business/q_bida/q_bida_server.go b/business/q_bida/q_bida_server.go index 28dc14d12..e6fb7faf7 100644 --- a/business/q_bida/q_bida_server.go +++ b/business/q_bida/q_bida_server.go @@ -40,6 +40,8 @@ var LogisticsCompany = []int{ bida.DBLogisticsExpressInt, } +const MarkupAmount = 50 // 每公斤加价五毛 + // QueryExpressPrice 查询配送价格,获取所有快递价格 func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpressPriceRes, error) { if param.Weight <= 0 { @@ -50,7 +52,7 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr result := make(map[string]*bida.GetExpressPriceRes, 0) if param.Type == 0 { - // 渠道费每公斤加价两毛 + // 渠道费每公斤加价五毛 switch param.ChannelType { case 1: // 快递 for i := 0; i < len(ExpressCompany); i++ { @@ -64,7 +66,7 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr continue } if fee.Data.ChannelFee != 0 { - addFee := int(fee.Data.ChannelFee*100) + param.Weight*20 + addFee := int(fee.Data.ChannelFee*100) + param.Weight*MarkupAmount fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100) result[fmt.Sprintf("%d", ExpressCompany[i])] = fee } @@ -81,7 +83,7 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr continue } if fee.Data.ChannelFee != 0 { - addFee := int(fee.Data.ChannelFee*100) + param.Weight*20 + addFee := int(fee.Data.ChannelFee*100) + param.Weight*MarkupAmount fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100) result[fmt.Sprintf("%d", LogisticsCompany[i])] = fee } @@ -98,7 +100,7 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr } if fee.Data.ChannelFee != 0 { - addFee := int(fee.Data.ChannelFee*100) + param.Weight*20 + addFee := int(fee.Data.ChannelFee*100) + param.Weight*MarkupAmount fee.Data.ChannelFee = utils.Int2Float64(addFee) / float64(100) result[fmt.Sprintf("%d", param.Type)] = fee } diff --git a/controllers/wxpay_callback.go b/controllers/wxpay_callback.go index 519c8d45e..dba0951c1 100644 --- a/controllers/wxpay_callback.go +++ b/controllers/wxpay_callback.go @@ -18,6 +18,7 @@ type WXPayController struct { } func (c *WXPayController) Msg() { + globals.SugarLogger.Debug("ceshihuidiaohanhu================", c.Ctx.Input.Method()) if c.Ctx.Input.Method() == http.MethodPost { msg, callbackResponse := api.WxpayAPI.GetCallbackMsg(c.Ctx.Request) globals.SugarLogger.Debugf("wxpayapi callback msg:%s, callbackResponse:%s, %t", utils.Format4Output(msg, true), utils.Format4Output(callbackResponse, true), callbackResponse == nil)