package gmodel

import (
	"gorm.io/gorm"
	"time"
)

// fs_cart 购物车
type FsCart struct {
	Id         int64      `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
	UserId     *int64     `gorm:"index;default:0;" json:"user_id"`                 //
	ProductId  *int64     `gorm:"index;default:0;" json:"product_id"`              // 产品ID
	TemplateId *int64     `gorm:"index;default:0;" json:"template_id"`             // 模板ID
	PriceId    *int64     `gorm:"index;default:0;" json:"price_id"`                // 价格ID
	MaterialId *int64     `gorm:"index;default:0;" json:"material_id"`             // 材质ID
	SizeId     *int64     `gorm:"index;default:0;" json:"size_id"`                 // 尺寸ID
	BuyNum     *int64     `gorm:"default:0;" json:"buy_num"`                       // 购买数量
	Cover      *string    `gorm:"default:'';" json:"cover"`                        // 截图
	DesignId   *int64     `gorm:"index;default:0;" json:"design_id"`               // 设计ID
	Ctime      *int64     `gorm:"default:0;" json:"ctime"`                         //
	Status     *int64     `gorm:"default:0;" json:"status"`                        // 状态位
	OptionalId *int64     `gorm:"index;default:0;" json:"optional_id"`             // 选项ID
	IsCheck    *int64     `gorm:"default:0;" json:"is_check"`                      // 是否选中状态(0:未选中,1:选中)
	TsTime     *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ts_time"`   //
	IsEmail    *int64     `gorm:"default:0;" json:"is_email"`                      // 是否发送邮件
}
type FsCartModel struct {
	db   *gorm.DB
	name string
}

func NewFsCartModel(db *gorm.DB) *FsCartModel { return &FsCartModel{db: db, name: "fs_cart"} }