- for elm order, the type of order msg must in resaonable sequence.

This commit is contained in:
gazebo
2018-07-05 11:04:47 +08:00
parent a83e2102a5
commit c43ec48837

View File

@@ -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