- for elm order, the type of order msg must in resaonable sequence.
This commit is contained in:
@@ -72,7 +72,7 @@ func (o *OrderController) NewOrder(msg *elmapi.CallbackMsg, orderId string, user
|
||||
globals.SugarLogger.Warnf("error when calling ReadOrCreate, error:%v, rec:%v", err, rec)
|
||||
retVal = errResponseDBError
|
||||
} else {
|
||||
if created || rec.Type != msg.Type {
|
||||
if created || rec.Type < msg.Type {
|
||||
// todo 回调消息里已经有详情,这里是否有必要再取一次?
|
||||
result, err := globals2.ElmAPI.GetOrder(orderId)
|
||||
if err != nil {
|
||||
@@ -113,7 +113,7 @@ func (o *OrderController) OrderStatusChanged(msg *elmapi.CallbackMsg, orderId st
|
||||
if err != nil {
|
||||
globals.SugarLogger.Warnf("error when calling ReadOrCreate, error:%v, rec:%v", err, rec)
|
||||
} else {
|
||||
if rec.Type != msg.Type {
|
||||
if rec.Type < msg.Type {
|
||||
err = globals2.FreshFoodAPI.ELMOrderStatus(orderId, msg.Type, utils.GetCurTimeStr())
|
||||
if err == nil {
|
||||
rec.Type = msg.Type
|
||||
|
||||
Reference in New Issue
Block a user