- call GetJxStoreIDFromOrder at first place

This commit is contained in:
gazebo
2018-10-28 13:36:42 +08:00
parent cfa09f94be
commit a188f48253
2 changed files with 5 additions and 4 deletions

View File

@@ -71,15 +71,16 @@ func (c *BaseScheduler) PickupGoodsAndUpdateStatus(ctx *jxcontext.Context, vendo
}
func getStoreDeliveryType(order *model.GoodsOrder) (deliveryType int) {
jxStoreID := jxutils.GetJxStoreIDFromOrder(order)
if globals.OrderUseNewTable {
deliveryType = scheduler.StoreDeliveryTypeByPlatform // 缺省值
if storeMap, _ := dao.GetStoreMapByStoreID(nil, jxutils.GetJxStoreIDFromOrder(order), order.VendorID); storeMap != nil {
if storeMap, _ := dao.GetStoreMapByStoreID(nil, jxStoreID, order.VendorID); storeMap != nil {
deliveryType = int(storeMap.DeliveryType)
}
return deliveryType
}
storefeature := &legacymodel2.Jxstorefeature{
Id: jxutils.GetJxStoreIDFromOrder(order),
Id: jxStoreID,
}
if storefeature.Id != 0 {
db := orm.NewOrm()

View File

@@ -101,8 +101,8 @@ func (s *WatchOrderInfo) SetOrder(order *model.GoodsOrder) (retVal *model.GoodsO
func (s *WatchOrderInfo) updateOrderStoreFeature(order *model.GoodsOrder) (err error) {
globals.SugarLogger.Debugf("updateOrderStoreFeature orderID:%s", order.VendorOrderID)
jxStoreID := jxutils.GetJxStoreIDFromOrder(order)
if globals.OrderUseNewTable {
jxStoreID := jxutils.GetJxStoreIDFromOrder(order)
if jxStoreID > 0 {
db := dao.GetDB()
storeMap, err2 := dao.GetStoreMapByStoreID(db, jxStoreID, order.VendorID)
@@ -134,7 +134,7 @@ func (s *WatchOrderInfo) updateOrderStoreFeature(order *model.GoodsOrder) (err e
return err
}
storefeature := &legacymodel2.Jxstorefeature{
Id: jxutils.GetJxStoreIDFromOrder(order),
Id: jxStoreID,
}
if storefeature.Id > 0 {
db := orm.NewOrm()