Files
ai_dianshang/server/internal/model/service.go

45 lines
1.9 KiB
Go
Raw Normal View History

2025-11-17 14:11:46 +08:00
package model
import (
"time"
)
// AfterSale 售后服务
type AfterSale struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
OrderID uint `json:"order_id" gorm:"not null"`
OrderItemID uint `json:"order_item_id" gorm:"not null"`
UserID uint `json:"user_id" gorm:"not null"`
Type int `json:"type" gorm:"not null"` // 1退货2换货3维修
Reason string `json:"reason" gorm:"size:255;not null"`
Description string `json:"description" gorm:"type:text"`
Images JSONSlice `json:"images" gorm:"type:json"`
Status int `json:"status" gorm:"default:1"` // 1待审核2已同意3已拒绝4处理中5已完成
AdminRemark string `json:"admin_remark" gorm:"type:text"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// 关联数据
Order Order `json:"order,omitempty" gorm:"foreignKey:OrderID"`
OrderItem OrderItem `json:"order_item,omitempty" gorm:"foreignKey:OrderItemID"`
User User `json:"user,omitempty" gorm:"foreignKey:UserID"`
}
// Invoice 发票
type Invoice struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
OrderID uint `json:"order_id" gorm:"not null"`
UserID uint `json:"user_id" gorm:"not null"`
Type int `json:"type" gorm:"not null"` // 1个人2企业
Title string `json:"title" gorm:"size:255;not null"`
TaxNumber string `json:"tax_number" gorm:"size:50"`
Amount float64 `json:"amount" gorm:"type:decimal(10,2);not null"`
Status int `json:"status" gorm:"default:1"` // 1待开具2已开具3已邮寄
InvoiceNo string `json:"invoice_no" gorm:"size:50"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
// 关联数据
Order Order `json:"order,omitempty" gorm:"foreignKey:OrderID"`
User User `json:"user,omitempty" gorm:"foreignKey:UserID"`
}