账号上下架增加统计
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"time"
|
||||
|
||||
"hfb_sys/backend/internal/auditlog"
|
||||
"hfb_sys/backend/internal/listingstatus"
|
||||
"hfb_sys/backend/internal/model"
|
||||
"hfb_sys/backend/internal/modules/notification"
|
||||
"hfb_sys/backend/internal/modules/wallet"
|
||||
@@ -178,11 +179,23 @@ func (r *Repository) Complete(ctx context.Context, pickupID uint64, req Complete
|
||||
}
|
||||
|
||||
// listing 置 completed:listingLockedForOwnerMutation 已拦截此状态再上架。
|
||||
fromStatus := listing.Status
|
||||
listing.InTransaction = true
|
||||
listing.Status = "completed"
|
||||
if err := tx.Save(&listing).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
if err := listingstatus.AppendTransition(
|
||||
tx,
|
||||
&listing,
|
||||
fromStatus,
|
||||
listingstatus.SourcePickup,
|
||||
listingstatus.ActorAdmin,
|
||||
0,
|
||||
"管理员提号完成",
|
||||
); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := wallet.AppendEntries(tx, wallet.Entry{
|
||||
UserID: pickup.OwnerID,
|
||||
|
||||
Reference in New Issue
Block a user