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.

55 lines
1.2 KiB

package model
import (
"database/sql"
"time"
)
const (
OrderSaleAuditTypeDownPayment = 1 // 首付审核
OrderSaleAuditTypeBalancePayment = 2 // 尾款审核
OrderSaleAuditStatusAudit = 1 // 待审核
OrderSaleAuditStatusAdopt = 2 // 审核通过
OrderSaleAuditStatusReject = 3 // 审核驳回
)
func (*OrderSaleAudit) GetStatusName(status uint) (result string) {
switch status {
case 1:
return "待审核"
case 2:
return "审核通过"
case 3:
return "审核驳回"
default:
return "未知状态"
}
}
func (*OrderSaleAudit) GetTypeName(tp uint) (result string) {
switch tp {
case 1:
return "首付审核"
case 2:
return "尾款审核"
default:
return "未知"
}
}
type OrderSaleAudit struct {
Id uint `gorm:"primaryKey"`
OrderId uint // 订单id
Order *OrderSale `gorm:"foreignKey:OrderId"`
Type uint // 1=首付审核 2=尾款审核
Status uint // 1=待审核 2=审核通过 3=审核驳回
AuditAt sql.NullTime // 审核时间
Proof string // 付款凭证
Reason string // 驳回原因
AuditUserId uint // 审核人
AuditUser Manage `gorm:"foreignKey:AuditUserId"`
CreatedAt time.Time
UpdatedAt time.Time
}