- limit dada cargoprice to 63.99

This commit is contained in:
gazebo
2018-07-30 16:28:25 +08:00
parent 0464042d49
commit a7d63caf08

View File

@@ -15,6 +15,10 @@ import (
"github.com/astaxie/beego/orm"
)
const (
maxCargoPrice = 63.99 // 单位为元,达达最大价格,超过这个价格配送费会增加
)
var (
ErrCanNotFindDadaCityCode = errors.New("不能找到美团配送站点配置")
)
@@ -81,6 +85,10 @@ func (c *WaybillController) CreateWaybill(order *model.GoodsOrder) (err error) {
ReceiverAddress: order.ConsigneeAddress,
ReceiverPhone: order.ConsigneeMobile,
}
if billParams.CargoPrice > maxCargoPrice {
billParams.CargoPrice = maxCargoPrice
}
if billParams.CityCode, err = c.getDataCityCodeFromOrder(order); err == nil {
billParams.ReceiverLng, billParams.ReceiverLat, _ = jxutils.IntCoordinate2MarsStandard(order.ConsigneeLng, order.ConsigneeLat, order.CoordinateType)
addParams := map[string]interface{}{