- handle Jdorder code is only 2 characters.
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
MsgNotHandledCode = "9527"
|
||||
MsgNotHandledCode = "NH"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -98,15 +98,15 @@ func (c *OrderController) OrderStatus(order *jdapi.CallbackOrderMsg) *jdapi.Call
|
||||
OrderStatusTime: order.Timestamp,
|
||||
}
|
||||
|
||||
if created, _, err := db.ReadOrCreate(rec, "Jdorderid"); err == nil {
|
||||
if created, _, err := db.ReadOrCreate(rec, "JdOrderID"); err == nil {
|
||||
order.ID = rec.ID
|
||||
if created {
|
||||
if order.StatusID != jdapi.OrderStatusNew && order.StatusID != jdapi.OrderStatusAdjust {
|
||||
globals.SugarLogger.Warnf("order:%v get before create", order)
|
||||
oldStatusId := order.StatusID
|
||||
oldStatusID := order.StatusID
|
||||
order.StatusID = jdapi.OrderStatusNew
|
||||
addOrderMsg(order)
|
||||
order.StatusID = oldStatusId
|
||||
order.StatusID = oldStatusID
|
||||
}
|
||||
addOrderMsg(order)
|
||||
} else {
|
||||
|
||||
@@ -2,11 +2,11 @@ package models
|
||||
|
||||
type Jdorder struct {
|
||||
ID int `orm:"column(id)"`
|
||||
Code string `orm:"size(8)"`
|
||||
Code string `orm:"size(2)"`
|
||||
Msg string `orm:"size(100)"`
|
||||
Data string `orm:"type(text)"`
|
||||
Success int8
|
||||
JdOrderID int64 `orm:"unique;column(jdorderid)"`
|
||||
JdOrderID int64 `orm:"unique;size(19);column(jdorderid)"`
|
||||
CityName string `orm:"size(20);column(cityname)"`
|
||||
OrderStatus int `orm:"column(orderstatus)"`
|
||||
OrderStatusTime string `orm:"size(50);column(orderstatustime)"`
|
||||
|
||||
Reference in New Issue
Block a user