用户管理增加余额调账功能

支持后台加减可用余额并写入资金流水与审计,优化操作列按钮样式。
This commit is contained in:
yml2213
2026-07-13 21:30:38 +08:00
parent a2a9ade68e
commit b96d6141f5
10 changed files with 642 additions and 57 deletions
@@ -165,6 +165,11 @@ func AppendEntries(tx *gorm.DB, entries ...Entry) error {
}
func ensureAccount(tx *gorm.DB, userID uint64) error {
return EnsureAccountTx(tx, userID)
}
// EnsureAccountTx 在事务内确保用户钱包账户存在(幂等)。
func EnsureAccountTx(tx *gorm.DB, userID uint64) error {
account := model.WalletAccount{
UserID: userID,
AvailableBalanceCent: 0,