Documentation ¶
Index ¶
- type Cart
- type CartDB
- func (db *CartDB) Delete(cartID int) error
- func (db *CartDB) DeleteStoreAll(userID, storeID int) error
- func (db *CartDB) GetByGoods(userID, goodsID, specID int) (*Cart, error)
- func (db *CartDB) GetByID(cartID int) (*Cart, error)
- func (db *CartDB) GetCount(userID int) (int, error)
- func (db *CartDB) InsertCart(count, userID, storeID, goodsID, specID int, ...) error
- func (db *CartDB) ListAll(userID int) ([]Cart, error)
- func (db *CartDB) ListSelected(userID int) ([]Cart, error)
- func (db *CartDB) ListStoreAll(userID, storeID int) ([]Cart, error)
- func (db *CartDB) ListStoreSelected(userID, storeID int) ([]Cart, error)
- func (db *CartDB) ListStoreUnSelected(userID, storeID int) ([]Cart, error)
- func (db *CartDB) Selected(cartID int) error
- func (db *CartDB) SelectedAll(userID, storeID int) error
- func (db *CartDB) UnSelected(cartID int) error
- func (db *CartDB) UnSelectedAll(userID, storeID int) error
- func (db *CartDB) UpdateCount(cartID, count int) error
- type CartTx
- func (tx *CartTx) Delete(cartID int) error
- func (tx *CartTx) DeleteSelect(userID int) error
- func (tx *CartTx) DeleteStoreSelected(userID, storeID int) error
- func (tx *CartTx) Update(cartID int, zoomImg, goodsLabel, specLabel string, payPrice float32) error
- func (tx *CartTx) UpdateCount(cartID, count int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cart ¶
type Cart struct { CartID int `json:"cartID" db:"cart_id"` // 表ID Active bool `json:"active" db:"active"` // 是否可用 Selected bool `json:"selected" db:"selected"` // 是否选中 Count int `json:"count" db:"count"` // 数量 UserID int `json:"userID" db:"user_id"` // 用户ID StoreID int `json:"storeID" db:"store_id"` // 店铺ID GoodsID int `json:"goodsID" db:"goods_id"` // 商品ID ZoomImg string `json:"zoomImg" db:"zoom_img"` // 缩放图 GoodsLabel string `json:"goodsLabel" db:"goods_label"` // 商品名称 SpecID int `json:"specID" db:"spec_id"` // 规格ID,0代表没有规格 SpecLabel string `json:"specLabel" db:"spec_label"` // 规格名称,下划线分割,例如:红色_L PayPrice float32 `json:"payPrice" db:"pay_price"` // 购买价 CreateTime time.Time `json:"createTime" db:"create_time"` // 创建时间 UpdateTime time.Time `json:"updateTime" db:"update_time"` // 更新时间 }
Cart 购物车
type CartDB ¶
func (*CartDB) DeleteStoreAll ¶
DeleteStoreAll 清空用户店铺购物车
func (*CartDB) GetByGoods ¶
GetByGoods 获取用户购物车内指定商品和商品规格
func (*CartDB) InsertCart ¶
func (db *CartDB) InsertCart(count, userID, storeID, goodsID, specID int, zoomImg, goodsLabel, specLabel string, payPrice float32) error
InsertCart 添加活动购物车
func (*CartDB) ListSelected ¶
ListSelected 列出所有选中的购物车
func (*CartDB) ListStoreAll ¶
ListStoreAll 列出店铺购物车商品
func (*CartDB) ListStoreSelected ¶
ListStoreSelected 列出店铺购物车选中商品
func (*CartDB) ListStoreUnSelected ¶
ListStoreUnSelected 列出店铺购物车未选中商品
func (*CartDB) SelectedAll ¶
SelectedAll 选中店铺所有商品
func (*CartDB) UnSelectedAll ¶
UnSelectedAll 取消选中店铺所有商品
Click to show internal directories.
Click to hide internal directories.