1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user