DengBiao 1 år sedan
förälder
incheckning
a998d29a84
2 ändrade filer med 16 tillägg och 10 borttagningar
  1. +14
    -10
      consume/canal_guide_order_consume.go
  2. +2
    -0
      consume/md/md_canal_guide_order_consume.go

+ 14
- 10
consume/canal_guide_order_consume.go Visa fil

@@ -74,16 +74,17 @@ func handleGuideOrdTable(msg []byte) error {
provinceId, cityId, countyId, provinceName, cityName, countyName := getUserAddress(db.DBs[masterId], data.Uid)
now := time.Now()
esData := esMd.ZhiosOrdersEs{
OrdKind: "guide",
MasterId: utils.StrToInt(masterId),
OrdId: data.OrdId,
MainOrdId: data.ParentOrdId,
StoreOrdId: data.PvdOid,
GoodsId: data.ItemId,
Uid: data.Uid,
BuyerPhone: user.Phone,
CostPrice: utils.StrToFloat64(data.CostPrice),
Gmv: utils.StrToFloat64(data.CostPrice) * float64(utils.StrToInt(data.ItemNum)),
OrdKind: "guide",
MasterId: utils.StrToInt(masterId),
OrdId: data.OrdId,
MainOrdId: data.ParentOrdId,
StoreOrdId: data.PvdOid,
GoodsId: data.ItemId,
Uid: data.Uid,
BuyerPhone: user.Phone,
CostPrice: utils.StrToFloat64(data.PaidPrice),
//Gmv: utils.StrToFloat64(data.CostPrice) * float64(utils.StrToInt(data.ItemNum)),
Gmv: utils.StrToFloat64(data.PaidPrice),
State: int32(utils.StrToInt(data.State)),
StateZh: md.CanalGuideOrderState(int32(utils.StrToInt(data.State))).String(),
GoodsNum: utils.StrToInt(data.ItemNum),
@@ -106,6 +107,9 @@ func handleGuideOrdTable(msg []byte) error {
CreatedAt: now.Format("2006-01-02 15:04:05"),
UpdatedAt: now.Format("2006-01-02 15:04:05"),
}
if esData.GoodsNum == 0 {
esData.GoodsNum = 1
}
if esData.PayTime == "" {
esData.PayTime = "1970-01-01 00:00:00"
}


+ 2
- 0
consume/md/md_canal_guide_order_consume.go Visa fil

@@ -9,6 +9,8 @@ type CanalGuideOrder struct {
ItemId string `json:"item_id"`
Uid string `json:"uid"`
CostPrice string `json:"cost_price"`
PaidPrice string `json:"paid_price"`
ItemPrice string `json:"item_price"`
State string `json:"state"`
OrderType string `json:"order_type"`
ItemNum string `json:"item_num"`


Laddar…
Avbryt
Spara