diff --git a/consume/canal_guide_order_consume.go b/consume/canal_guide_order_consume.go index 20a8571..971e25c 100644 --- a/consume/canal_guide_order_consume.go +++ b/consume/canal_guide_order_consume.go @@ -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" } diff --git a/consume/md/md_canal_guide_order_consume.go b/consume/md/md_canal_guide_order_consume.go index a1d66ca..e8e80a0 100644 --- a/consume/md/md_canal_guide_order_consume.go +++ b/consume/md/md_canal_guide_order_consume.go @@ -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"`