package model import ( "database/sql" "github.com/shopspring/decimal" "gorm.io/gorm" "time" ) const ( SplitAccountStatusInProgress = 1 // 进行中 SplitAccountStatusFinish = 2 // 已完成 ) type SplitAccount struct { Id uint `gorm:"primaryKey"` Name string // 分账名称 SponsorId uint // 发起人 Broker Broker `gorm:"foreignKey:SponsorId"` LastBill string // 最近一次账单 Status uint // 分账状态 1=进行中 2=已完成 TotalAmount decimal.Decimal // 分账总额 BillAmount decimal.Decimal // 账目总额 SaleAmount decimal.Decimal // 出售总额 ModelId uint // 车型id Model CarModel `gorm:"foreignKey:ModelId;references:ModelId"` LocationId uint // 车辆所在地 Location Area `gorm:"foreignKey:LocationId"` LicensingDate sql.NullTime // 上牌日期 Color string // 车身颜色 Mileage decimal.Decimal // 里程 Brokers []SplitAccountBroker `gorm:"foreignKey:AccountId"` Bills []SplitAccountBill `gorm:"foreignKey:AccountId"` SaleAt sql.NullTime // 出售时间 CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt }