作者 陈志颖

fix:小程序同步销售日期

... ... @@ -87,7 +87,7 @@ func (s SyncOrderService) SyncOrderFromBestshop(cmd command.CreateOrderFromBests
/**
* @Author SteveChan
* @Description //TODO 同步小程序订单,增加销售时间
* @Description //同步小程序订单,增加销售时间
* @Date 23:53 2021/1/26
* @Param
* @return
... ... @@ -266,7 +266,7 @@ func (s SyncOrderService) copyOrderBestshopToOrderBase(orderBestshop *domain.Ord
orderbase.PartnerCategory = domain.PartnerCategory{Id: 1, Name: "事业合伙人"}
orderbase.Compute()
// 销售日期
orderbase.SaleDate = orderBestshop.CreateTime
//orderbase.SaleDate = orderBestshop.CreateTime
err = orderBaseRepository.Save(&orderbase)
if err != nil {
e := fmt.Sprintf("添加order_base数据失败%s", err)
... ...
... ... @@ -59,6 +59,7 @@ func (order OrderBestShop) CopyToOrderBase(o *OrderBase) {
o.OrderCompute.PlanOrderAmount = order.OrderAmount
o.OrderCompute.PlanOrderCount = order.OrderCount
o.DeliveryTime, _ = time.Parse("2006-01-02 15:04:05", order.DeliveryTime)
o.SaleDate = order.CreateTime
o.RegionInfo.RegionName = order.OrderArea
return
}
... ...
... ... @@ -84,9 +84,9 @@ func (repository OrderBaseRepository) Save(orderInfo *domain.OrderBase) error {
Remark: orderInfo.Remark,
PartnerCategory: orderInfo.PartnerCategory,
}
if m.OrderType > 2 { // TODO 非平台自建订单,默认销售日期取订单创建日期
m.SaleDate = orderInfo.CreateTime
}
//if m.OrderType > 2 { // TODO 非平台自建订单,默认销售日期取订单创建日期
// m.SaleDate = orderInfo.CreateTime
//}
if m.Id == 0 {
_, err = tx.Model(m).
Returning("*").
... ...