dt_finance.go 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package daytask
  2. // DtWithdrawOrder 提现订单表
  3. type DtWithdrawOrder struct {
  4. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:订单ID"`
  5. OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(32);not null;uniqueIndex:uk_order_no;comment:订单编号"`
  6. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;not null;index:idx_user_id;comment:用户ID"`
  7. UserUid string `json:"userUid" gorm:"column:user_uid;type:varchar(32);comment:用户UID"`
  8. Channel string `json:"channel" gorm:"column:channel;type:varchar(32);not null;index:idx_channel;comment:提现渠道: usdt/momo/zalopay/bank"`
  9. Amount float64 `json:"amount" gorm:"column:amount;type:decimal(18,2);default:0.00;comment:提现金额(USDT)"`
  10. ActualAmount float64 `json:"actualAmount" gorm:"column:actual_amount;type:decimal(18,2);default:0.00;comment:实际到账"`
  11. Fee float64 `json:"fee" gorm:"column:fee;type:decimal(18,2);default:0.00;comment:手续费"`
  12. ExchangeRate float64 `json:"exchangeRate" gorm:"column:exchange_rate;type:decimal(18,6);default:1.000000;comment:汇率"`
  13. ReceiveAmount float64 `json:"receiveAmount" gorm:"column:receive_amount;type:decimal(18,2);default:0.00;comment:收款金额(原币种)"`
  14. ReceiveCurrency string `json:"receiveCurrency" gorm:"column:receive_currency;type:varchar(16);default:USDT;comment:收款币种"`
  15. PaymentId int64 `json:"paymentId" gorm:"column:payment_id;type:bigint;comment:收款方式ID"`
  16. PaymentInfo string `json:"paymentInfo" gorm:"column:payment_info;type:text;comment:收款账户信息(JSON)"`
  17. ReceiveAccount string `json:"receiveAccount" gorm:"column:receive_account;type:varchar(128);comment:收款账号"`
  18. ReceiveName string `json:"receiveName" gorm:"column:receive_name;type:varchar(64);comment:收款人姓名"`
  19. BankName string `json:"bankName" gorm:"column:bank_name;type:varchar(64);comment:银行名称"`
  20. Txid string `json:"txid" gorm:"column:txid;type:varchar(128);comment:交易哈希/流水号"`
  21. PayScreenshot string `json:"payScreenshot" gorm:"column:pay_screenshot;type:varchar(255);comment:打款截图"`
  22. ApplyTime int64 `json:"applyTime" gorm:"column:apply_time;type:bigint;comment:申请时间"`
  23. AuditTime int64 `json:"auditTime" gorm:"column:audit_time;type:bigint;comment:审核时间"`
  24. AuditAdminId int64 `json:"auditAdminId" gorm:"column:audit_admin_id;type:bigint;comment:审核管理员ID"`
  25. PayTime int64 `json:"payTime" gorm:"column:pay_time;type:bigint;comment:打款时间"`
  26. PayAdminId int64 `json:"payAdminId" gorm:"column:pay_admin_id;type:bigint;comment:打款管理员ID"`
  27. RejectReason string `json:"rejectReason" gorm:"column:reject_reason;type:varchar(255);comment:拒绝原因"`
  28. Remark string `json:"remark" gorm:"column:remark;type:varchar(255);comment:备注"`
  29. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:0;index:idx_status;comment:状态: 0=待审核 1=审核通过 2=已打款 3=已完成 4=已拒绝 5=已取消"`
  30. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
  31. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  32. }
  33. func (*DtWithdrawOrder) TableName() string {
  34. return "dt_withdraw_order"
  35. }
  36. func NewDtWithdrawOrder() *DtWithdrawOrder {
  37. return &DtWithdrawOrder{}
  38. }
  39. // DtBalanceLog 资金流水表
  40. type DtBalanceLog struct {
  41. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:流水ID"`
  42. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;not null;index:idx_user_id;comment:用户ID"`
  43. UserUid string `json:"userUid" gorm:"column:user_uid;type:varchar(32);comment:用户UID"`
  44. Type string `json:"type" gorm:"column:type;type:varchar(32);not null;index:idx_type;comment:类型: recharge/withdraw/task_reward/invite_reward/level_purchase/refund/adjust"`
  45. Amount float64 `json:"amount" gorm:"column:amount;type:decimal(18,2);default:0.00;comment:变动金额"`
  46. BalanceBefore float64 `json:"balanceBefore" gorm:"column:balance_before;type:decimal(18,2);default:0.00;comment:变动前余额"`
  47. BalanceAfter float64 `json:"balanceAfter" gorm:"column:balance_after;type:decimal(18,2);default:0.00;comment:变动后余额"`
  48. RelatedId int64 `json:"relatedId" gorm:"column:related_id;type:bigint;comment:关联ID"`
  49. RelatedNo string `json:"relatedNo" gorm:"column:related_no;type:varchar(32);comment:关联单号"`
  50. Title string `json:"title" gorm:"column:title;type:varchar(128);comment:流水标题"`
  51. Remark string `json:"remark" gorm:"column:remark;type:varchar(255);comment:备注"`
  52. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
  53. }
  54. func (*DtBalanceLog) TableName() string {
  55. return "dt_balance_log"
  56. }
  57. func NewDtBalanceLog() *DtBalanceLog {
  58. return &DtBalanceLog{}
  59. }