Merge pull request 'main' (#543) from main into test
Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/543
This commit is contained in:
commit
ac3040a3eb
|
@ -22,6 +22,9 @@ func ZoneCreateOrder(ctx *gin.Context) {
|
||||||
ReplyErrorMsg(ctx, "商品错误")
|
ReplyErrorMsg(ctx, "商品错误")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if len(req.Model) >= 28 {
|
||||||
|
req.Model = req.Model[:28]
|
||||||
|
}
|
||||||
|
|
||||||
data, ec, err := service.DefaultService.ZoneCreateOrder(ctx, req)
|
data, ec, err := service.DefaultService.ZoneCreateOrder(ctx, req)
|
||||||
if ec != errcode.ErrCodeVasSrvOk {
|
if ec != errcode.ErrCodeVasSrvOk {
|
||||||
|
|
|
@ -299,12 +299,12 @@ func (m *Mysql) GetOrderCnt(ctx *gin.Context, tx *sqlx.Tx, mid, st, et int64, or
|
||||||
// 更新订单状态
|
// 更新订单状态
|
||||||
func (m *Mysql) UpdateOrderStatus(ctx *gin.Context, tx *sqlx.Tx, orderId string, preStatus, aftStatus int32) error {
|
func (m *Mysql) UpdateOrderStatus(ctx *gin.Context, tx *sqlx.Tx, orderId string, preStatus, aftStatus int32) error {
|
||||||
var err error
|
var err error
|
||||||
sqlStr := "update " + TableOrder + " set order_status=? where id=? and order_status=?"
|
sqlStr := "update " + TableOrder + " set order_status=?,ut=? where id=? and order_status=?"
|
||||||
if tx != nil {
|
if tx != nil {
|
||||||
_, err = tx.ExecContext(ctx, sqlStr, aftStatus, orderId, preStatus)
|
_, err = tx.ExecContext(ctx, sqlStr, aftStatus, time.Now().Unix(), orderId, preStatus)
|
||||||
} else {
|
} else {
|
||||||
db := m.getDBVas()
|
db := m.getDBVas()
|
||||||
_, err = db.ExecContext(ctx, sqlStr, aftStatus, orderId, preStatus)
|
_, err = db.ExecContext(ctx, sqlStr, aftStatus, time.Now().Unix(), orderId, preStatus)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("UpdateOrderStatus fail, orderId: %v, preStatus: %v, aftStatus: %v, err: %v", orderId, preStatus, aftStatus, err)
|
logger.Error("UpdateOrderStatus fail, orderId: %v, preStatus: %v, aftStatus: %v, err: %v", orderId, preStatus, aftStatus, err)
|
||||||
|
|
Loading…
Reference in New Issue