修复完成订单自动回显
This commit is contained in:
@@ -973,9 +973,7 @@ func (r *Repository) finalizeCheckout(tx *gorm.DB, order *model.RentalOrder, che
|
||||
order.SettlementStatus = "settled"
|
||||
order.SettledAt = &now
|
||||
order.OwnerSettledAt = &now
|
||||
listing.Status = "published"
|
||||
listing.InTransaction = false
|
||||
account.Status = "published"
|
||||
archiveListingAfterCheckout(&listing, &account)
|
||||
orderID := order.ID
|
||||
settlement := buildCheckoutSettlement(*order, checkout)
|
||||
|
||||
@@ -1062,6 +1060,14 @@ func (r *Repository) finalizeCheckout(tx *gorm.DB, order *model.RentalOrder, che
|
||||
return refund, nil
|
||||
}
|
||||
|
||||
// 完成后的账号先下架,避免已完成订单对应的账号重新出现在公开首页。
|
||||
func archiveListingAfterCheckout(listing *model.RentalListing, account *model.GameAccount) {
|
||||
listing.Status = "offline"
|
||||
listing.InTransaction = false
|
||||
listing.PublishedAt = nil
|
||||
account.Status = "offline"
|
||||
}
|
||||
|
||||
func (r *Repository) prepareRefund(order *model.RentalOrder, amountCent int64, bizType string, remark string) (*refundAction, error) {
|
||||
if amountCent <= 0 {
|
||||
return nil, nil
|
||||
|
||||
Reference in New Issue
Block a user