- move some funcs from controller to jxutils.

This commit is contained in:
gazebo
2018-07-19 21:20:18 +08:00
parent 680c0a0696
commit fb2cd82e20
8 changed files with 62 additions and 62 deletions

View File

@@ -147,8 +147,8 @@ func (c *OrderController) getOrderInfo(orderID string) (order *model.GoodsOrder,
deliveryGeo := strings.Split(utils.Interface2String(result["deliveryGeo"]), ",")
if len(deliveryGeo) == 2 {
order.CoordinateType = model.CoordinateTypeMars
order.ConsigneeLng = controller.StandardCoordinate2Int(utils.Str2Float64(deliveryGeo[0]))
order.ConsigneeLat = controller.StandardCoordinate2Int(utils.Str2Float64(deliveryGeo[1]))
order.ConsigneeLng = jxutils.StandardCoordinate2Int(utils.Str2Float64(deliveryGeo[0]))
order.ConsigneeLat = jxutils.StandardCoordinate2Int(utils.Str2Float64(deliveryGeo[1]))
}
for _, group2 := range result["groups"].([]interface{}) {
@@ -162,7 +162,7 @@ func (c *OrderController) getOrderInfo(orderID string) (order *model.GoodsOrder,
SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["extendCode"]), 0)),
VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])),
SkuName: product["name"].(string),
SalePrice: controller.StandardPrice2Int(utils.MustInterface2Float64(product["userPrice"])),
SalePrice: jxutils.StandardPrice2Int(utils.MustInterface2Float64(product["userPrice"])),
Weight: int(math.Round(utils.Interface2FloatWithDefault(product["weight"], 0.0))),
OrderCreatedAt: order.OrderCreatedAt,
}