京东商城订单序号修改
This commit is contained in:
@@ -1169,15 +1169,18 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setJdsOrderSeq(order *model.GoodsOrder) (err error) {
|
func setJdsOrderSeq(order *model.GoodsOrder) (err error) {
|
||||||
var count int
|
type tCount struct {
|
||||||
|
Count int `json:"count"`
|
||||||
|
}
|
||||||
|
var count = &tCount{}
|
||||||
sql := `
|
sql := `
|
||||||
SELECT count(*) FROM goods_order WHERE store_id = ? AND order_create_at >= ? AND order_create_at <= ? AND vendor_id = ?
|
SELECT count(*) count FROM goods_order WHERE store_id = ? AND order_create_at >= ? AND order_create_at <= ? AND vendor_id = ?
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{
|
sqlParams := []interface{}{
|
||||||
order.StoreID, utils.Time2Date(time.Now()), utils.Time2Date(time.Now().AddDate(0, 0, 1)), order.VendorID,
|
order.StoreID, utils.Time2Date(time.Now()), utils.Time2Date(time.Now().AddDate(0, 0, 1)), order.VendorID,
|
||||||
}
|
}
|
||||||
err = dao.GetRow(dao.GetDB(), &count, sql, sqlParams)
|
err = dao.GetRow(dao.GetDB(), &count, sql, sqlParams)
|
||||||
order.OrderSeq = count + 1
|
order.OrderSeq = count.Count + 1
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user