package models import "gorm.io/datatypes" // SplitAccountDeductionLog 分账扣钱日志表 type SplitAccountDeductionLog struct { ID int64 `json:"id" gorm:"primarykey;comment:日志ID"` BusinessNo string `json:"business_no" gorm:"size:64;not null;default:'';comment:订单号"` ConfigID int64 `json:"config_id" gorm:"not null;default:0;comment:分账配置ID"` ConfigName string `json:"config_name" gorm:"size:200;not null;default:'';comment:分账配置名称"` DeductionDetails datatypes.JSON `json:"deduction_details" gorm:"type:json;comment:扣款规则(JSON数组)"` TotalAmount float64 `json:"total_amount" gorm:"type:decimal(15,2);not null;default:0.00;comment:总金额(分账前)"` DeductionAmount float64 `json:"deduction_amount" gorm:"type:decimal(15,2);not null;default:0.00;comment:扣款总金额"` RemainingAmount float64 `json:"remaining_amount" gorm:"type:decimal(15,2);not null;default:0.00;comment:剩余金额(分账后)"` Status int8 `json:"status" gorm:"type:tinyint;not null;default:0;comment:状态 0:正常 1:退款"` CreatedBy string `json:"created_by" gorm:"size:100;not null;default:'';comment:创建人/系统"` UpdatedBy string `json:"updated_by" gorm:"size:100;comment:更新人"` CreatedAt int64 `json:"created_at" gorm:"type:bigint;default:0;comment:创建时间戳(秒)"` UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;default:0;comment:更新时间戳(秒)"` } func (SplitAccountDeductionLog) TableName() string { return "split_account_deduction_log" }