dt_finance.go 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. ReceiveAccount string `json:"receiveAccount" gorm:"column:receive_account;type:varchar(128);comment:收款账号"`
  17. ReceiveName string `json:"receiveName" gorm:"column:receive_name;type:varchar(64);comment:收款人姓名"`
  18. BankName string `json:"bankName" gorm:"column:bank_name;type:varchar(64);comment:银行名称"`
  19. Txid string `json:"txid" gorm:"column:txid;type:varchar(128);comment:交易哈希/流水号"`
  20. PayScreenshot string `json:"payScreenshot" gorm:"column:pay_screenshot;type:varchar(255);comment:打款截图"`
  21. ApplyTime int64 `json:"applyTime" gorm:"column:apply_time;type:bigint;comment:申请时间"`
  22. AuditTime int64 `json:"auditTime" gorm:"column:audit_time;type:bigint;comment:审核时间"`
  23. AuditAdminId int64 `json:"auditAdminId" gorm:"column:audit_admin_id;type:bigint;comment:审核管理员ID"`
  24. PayTime int64 `json:"payTime" gorm:"column:pay_time;type:bigint;comment:打款时间"`
  25. PayAdminId int64 `json:"payAdminId" gorm:"column:pay_admin_id;type:bigint;comment:打款管理员ID"`
  26. RejectReason string `json:"rejectReason" gorm:"column:reject_reason;type:varchar(255);comment:拒绝原因"`
  27. Remark string `json:"remark" gorm:"column:remark;type:varchar(255);comment:备注"`
  28. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:0;index:idx_status;comment:状态: 0=待审核 1=审核通过 2=已打款 3=已完成 4=已拒绝 5=已取消"`
  29. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
  30. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  31. }
  32. func (*DtWithdrawOrder) TableName() string {
  33. return "dt_withdraw_order"
  34. }
  35. func NewDtWithdrawOrder() *DtWithdrawOrder {
  36. return &DtWithdrawOrder{}
  37. }
  38. // DtBalanceLog 资金流水表
  39. type DtBalanceLog struct {
  40. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:流水ID"`
  41. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;not null;index:idx_user_id;comment:用户ID"`
  42. UserUid string `json:"userUid" gorm:"column:user_uid;type:varchar(32);comment:用户UID"`
  43. 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"`
  44. Amount float64 `json:"amount" gorm:"column:amount;type:decimal(18,2);default:0.00;comment:变动金额"`
  45. BalanceBefore float64 `json:"balanceBefore" gorm:"column:balance_before;type:decimal(18,2);default:0.00;comment:变动前余额"`
  46. BalanceAfter float64 `json:"balanceAfter" gorm:"column:balance_after;type:decimal(18,2);default:0.00;comment:变动后余额"`
  47. RelatedId int64 `json:"relatedId" gorm:"column:related_id;type:bigint;comment:关联ID"`
  48. RelatedNo string `json:"relatedNo" gorm:"column:related_no;type:varchar(32);comment:关联单号"`
  49. Title string `json:"title" gorm:"column:title;type:varchar(128);comment:流水标题"`
  50. Remark string `json:"remark" gorm:"column:remark;type:varchar(255);comment:备注"`
  51. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
  52. }
  53. func (*DtBalanceLog) TableName() string {
  54. return "dt_balance_log"
  55. }
  56. func NewDtBalanceLog() *DtBalanceLog {
  57. return &DtBalanceLog{}
  58. }