23 lines
1.4 KiB
Go
23 lines
1.4 KiB
Go
|
|
package models
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"time"
|
|||
|
|
|
|||
|
|
"git.apinb.com/bsm-sdk/core/database"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// GasorderStatus 对应 gasorder_status,保存不可变订单状态历史。
|
|||
|
|
type GasorderStatus struct {
|
|||
|
|
Entity // 公共实体字段
|
|||
|
|
GasorderBasicID uint64 `gorm:"column:gasorder_basic_id;not null;index" json:"gasorder_basic_id"` // 订单自增主键
|
|||
|
|
FromStatus string `gorm:"column:from_status;type:varchar(32);not null;default:''" json:"from_status"` // 原状态
|
|||
|
|
ToStatus string `gorm:"column:to_status;type:varchar(32);not null;index" json:"to_status"` // 新状态
|
|||
|
|
OperatorIdentity string `gorm:"column:operator_identity;type:varchar(36);not null;default:''" json:"operator_identity"` // 操作人标识
|
|||
|
|
OperatorName string `gorm:"column:operator_name;type:varchar(64);not null;default:''" json:"operator_name"` // 操作人姓名快照
|
|||
|
|
OccurredAt time.Time `gorm:"column:occurred_at;type:timestamptz;not null;index" json:"occurred_at"` // 发生时间
|
|||
|
|
Reason string `gorm:"column:reason;type:text;not null;default:''" json:"reason"` // 变更原因
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func init() { database.AppendMigrate(&GasorderStatus{}) }
|
|||
|
|
func (table *GasorderStatus) TableName() string { return "gasorder_status" }
|