diff --git a/controller/order.go b/controller/order.go index 829a0ca..0cd36c9 100644 --- a/controller/order.go +++ b/controller/order.go @@ -398,7 +398,9 @@ func RentCardOrderCreate(c *gin.Context) { //fmt.Println("PayPrice:", order.PayPrice) if req.Price == 0 { - //tx := model.TransactionBegin() + if tx == nil { + tx = model.TransactionBegin() + } order.PayStatus = model.PayStatusPaid fmt.Println("orderId:", order.PayStatus) err = order.OrderCreate(tx)