- add refresh param for api GetStoreOrderInfo to get realtime CurrentConsigneeMobile.
This commit is contained in:
@@ -3,9 +3,9 @@ package orderman
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler/basesch"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
|
||||
"github.com/astaxie/beego/orm"
|
||||
)
|
||||
|
||||
@@ -121,7 +121,7 @@ func (c *OrderManager) GetOrderSkuInfo(vendorOrderID string, vendorID int) (skus
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func (c *OrderManager) GetOrderInfo(vendorOrderID string, vendorID int) (order *model.GoodsOrderExt, err error) {
|
||||
func (c *OrderManager) GetOrderInfo(vendorOrderID string, vendorID int, isRefresh bool) (order *model.GoodsOrderExt, err error) {
|
||||
globals.SugarLogger.Debugf("GetOrderInfo orderID:%s", vendorOrderID)
|
||||
db := orm.NewOrm()
|
||||
orders := []*model.GoodsOrderExt{}
|
||||
@@ -135,7 +135,15 @@ func (c *OrderManager) GetOrderInfo(vendorOrderID string, vendorID int) (order *
|
||||
`, vendorOrderID, vendorID).QueryRows(&orders)
|
||||
if err == nil && num > 0 {
|
||||
order = orders[0]
|
||||
globals.SugarLogger.Debug(order)
|
||||
if isRefresh && vendorID == model.VendorIDJD {
|
||||
tmpOrder, err2 := basesch.FixedBaseScheduler.GetPurchasePlatformFromVendorID(vendorID).GetOrder(vendorOrderID)
|
||||
if err = err2; err == nil {
|
||||
order.CurrentConsigneeMobile = tmpOrder.ConsigneeMobile
|
||||
} else {
|
||||
order.CurrentConsigneeMobile = "Error"
|
||||
globals.SugarLogger.Infof("GetOrderInfo GetOrder failed with error:%v", err2)
|
||||
}
|
||||
}
|
||||
return order, nil
|
||||
}
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user