新增订单轮询

This commit is contained in:
qiyunfanbo126.com 2024-09-04 17:09:32 +08:00
parent 6c9f3f3e6e
commit 64c0373eba
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ func CreateOrderService(userId int, productId int) (code int, data front.InsertO
utils.Log(nil, "CreateOrderService", err.Error())
return errorcode.SystemError, data
} else {
rs, err := session.Exec("update Products set stock = stock-1 where stock >= 1 and id = ?", product.Id)
rs, err := session.Exec("update products set stock = stock-1 where stock >= 1 and id = ?", product.Id)
var affect, _ = rs.RowsAffected()
if err != nil || affect < 1 {
session.Rollback()