You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.0 KiB

package model
import (
"database/sql"
"time"
)
const (
CarAuditTypePublish = 1 // 申请发布
CarAuditTypeUpper = 2 // 申请上架
CarAuditTypeDown = 3 // 申请下架
CarAuditTypeManageUpper = 4 // 后台上架
CarAuditTypeManageDown = 5 // 后台下架
)
type CarAudit struct {
Id uint `gorm:"primaryKey"`
CarId uint // 车辆id
CarBaseId uint // 车辆发布id
Type uint // 1=申请发布 2=申请上架 3=申请下架 0=未知
Status uint // 1=未审核 2=审核通过 3=审核驳回
AuditAt sql.NullTime // 审核时间
Reason string // 驳回原因
AuditUserId uint // 审核人
AuditUser Manage `gorm:"foreignKey:AuditUserId"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (*CarAudit) GetTypeName(tp uint) (result string) {
switch tp {
case CarAuditTypePublish:
return "申请发布"
case CarAuditTypeUpper:
return "申请上架"
case CarAuditTypeDown:
return "申请下架"
default:
return "未知"
}
}