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.
GO/app/model/customerCarPrice.go

69 lines
2.3 KiB

8 months ago
package model
import (
"github.com/shopspring/decimal"
"time"
)
const (
CustomerCarPricePayTypeAssess = 1 // 使用次数估值
CustomerCarPricePayTypePay = 2 // 付费估价
CustomerCarPricePayStatusUnPay = 1 // 待付款
CustomerCarPricePayStatusPay = 2 // 付款成功
CustomerCarPricePayStatusRefund = 3 // 退款成功
)
func (*CustomerCarPrice) GetTypeName(tp uint) (result string) {
switch tp {
case CustomerCarPricePayTypeAssess:
return "使用次数估值"
case CustomerCarPricePayTypePay:
return "付费估价"
default:
return "未知"
}
}
func (*CustomerCarPrice) GetStatusName(status uint) (result string) {
switch status {
case CustomerCarPricePayStatusUnPay:
return "待付款"
case CustomerCarPricePayStatusPay:
return "付款成功"
case CustomerCarPricePayStatusRefund:
return "退款成功"
default:
return "未知"
}
}
type CustomerCarPrice struct {
Id uint `gorm:"primaryKey"`
CustomerId uint // 客户id
Customer Customer `gorm:"foreignKey:CustomerId"`
PayType uint // 1=使用次数估值 2=付费估价
OrderId uint // 付费估价订单id
PayStatus uint // 付费估价订单状态 1=待付款 2=付款成功 3=退款成功
PriceId uint // 车辆价格id
CityId uint // 车300城市ID
City City `gorm:"foreignKey:CityId;references:CityId"`
ModelId uint // 车型id
Model CarModel `gorm:"foreignKey:ModelId;references:ModelId"`
Color string // 车身颜色
LicensingDate time.Time // 上牌日期
Mileage decimal.Decimal // 里程
Transfer uint // 过户次数
Paint uint // 油漆修复面数
Plate uint // 钣金修复面数
Parts string // 更换部件
Engine uint // 发动机状态
Accidents string // 重大事故
Maintain uint // 按时保养 0=未按时保养 1=按时保养
Score decimal.Decimal // 计算分值
Discount decimal.Decimal // 折扣
Price decimal.Decimal // 估算价格
FinalPrice decimal.Decimal // 到手价格
CreatedAt time.Time
}