账号上下架增加统计
This commit is contained in:
@@ -35,7 +35,9 @@ func (r *Repository) AdminClose(ctx context.Context, adminID uint64, orderID uin
|
||||
order.HandoffStatus = handoffStatusAdminClosed
|
||||
order.SettlementStatus = settlementStatusClosed
|
||||
order.SettledAt = &now
|
||||
archiveAssets(listing, account)
|
||||
if err := archiveAssets(tx, listing, account); err != nil {
|
||||
return err
|
||||
}
|
||||
if beforeOrderStatus != orderStatusPendingPayment {
|
||||
totalCent := order.RentAmountCent + order.DepositAmountCent
|
||||
// 押金暂扣:若订单已暂扣,拦截退款中的押金部分挂起不退,其余照常原路退。
|
||||
@@ -118,7 +120,9 @@ func (r *Repository) AdminMarkAbnormal(ctx context.Context, adminID uint64, orde
|
||||
beforeAccountStatus := account.Status
|
||||
order.Status = orderStatusAbnormal
|
||||
order.HandoffStatus = handoffStatusAdminAbnormal
|
||||
markAssetsAbnormal(listing, account)
|
||||
if err := markAssetsAbnormal(tx, listing, account); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := notification.Append(tx,
|
||||
notification.Entry{
|
||||
UserID: order.RenterID,
|
||||
@@ -450,7 +454,9 @@ func (r *Repository) AdminRejectRefund(ctx context.Context, orderID uint64, acti
|
||||
order.SettlementStatus = settlementStatusUnsettled
|
||||
order.SettledAt = nil
|
||||
reserveListingForOrder(listing)
|
||||
markAssetsRented(listing, account)
|
||||
if err := markAssetsRented(tx, listing, account); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
case "close":
|
||||
now := time.Now()
|
||||
@@ -458,7 +464,9 @@ func (r *Repository) AdminRejectRefund(ctx context.Context, orderID uint64, acti
|
||||
order.HandoffStatus = handoffStatusAdminClosed
|
||||
order.SettlementStatus = settlementStatusClosed
|
||||
order.SettledAt = &now
|
||||
archiveAssets(listing, account)
|
||||
if err := archiveAssets(tx, listing, account); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
default:
|
||||
return errors.New("无效的驳回操作,可选 restore 或 close")
|
||||
@@ -500,7 +508,9 @@ func (r *Repository) AdminSeal(ctx context.Context, adminID uint64, orderID uint
|
||||
order.HandoffStatus = handoffStatusAdminClosed
|
||||
order.SettlementStatus = settlementStatusClosed
|
||||
order.SettledAt = &now
|
||||
sealAssets(listing, account)
|
||||
if err := sealAssets(tx, listing, account); err != nil {
|
||||
return err
|
||||
}
|
||||
if beforeOrderStatus != orderStatusPendingPayment {
|
||||
totalCent := order.RentAmountCent + order.DepositAmountCent
|
||||
// 押金暂扣:若订单已暂扣,拦截退款中的押金部分挂起不退,其余照常原路退。
|
||||
|
||||
Reference in New Issue
Block a user