Documentation ¶
Index ¶
- func CheckProductIsVirtual(id int64, orgID int64) (b bool)
- func SendProductVirtual(productID int64, count int64, userID, orgID int64, orderID int64)
- func UpdateProduct(args ArgsUpdateProduct)
- type ArgsGetProduct
- type ArgsUpdateProduct
- type DataOtherOptionChild
- type DataOtherOptionChildList
- type DataOtherOptionSort
- type DataOtherOptions
- type FieldsCore
- type FieldsGivingTicket
- type FieldsGivingTickets
- type FieldsOtherOption
- type FieldsOtherOptionChild
- type FieldsOtherOptionChildList
- type FieldsOtherOptionSort
- type FieldsUserSubPrice
- type FieldsUserSubPrices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckProductIsVirtual ¶
CheckProductIsVirtual 检查商品是否为虚拟商品
func SendProductVirtual ¶
SendProductVirtual 处理虚拟商品,交付给用户
Types ¶
type ArgsGetProduct ¶
type ArgsGetProduct struct { //ID ID int64 `db:"id" json:"id" check:"id"` //组织ID // -1 跳过 OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` }
ArgsGetProduct 获取指定商品参数
type ArgsUpdateProduct ¶
type ArgsUpdateProduct struct { //ID ID int64 `db:"id" json:"id" check:"id"` //标题 Title string `db:"title" json:"title" check:"title" min:"1" max:"300"` //副标题 TitleDes string `db:"title_des" json:"titleDes" check:"title" min:"1" max:"300" empty:"true"` //商品描述 Des string `db:"des" json:"des" check:"des" min:"1" max:"6000" empty:"true"` //封面ID CoverFileIDs pq.Int64Array `db:"cover_file_ids" json:"coverFileIDs" check:"ids" empty:"true"` //描述图组 DesFiles pq.Int64Array `db:"des_files" json:"desFiles" check:"ids" empty:"true"` //货物重量 Weight int `db:"weight" json:"weight" check:"intThan0" empty:"true"` //建议售价 Price int64 `json:"price"` //不含税价格 PriceNoTax int64 `db:"price_no_tax" json:"priceNoTax" check:"price" empty:"true"` }
ArgsUpdateProduct 修改商品参数
type DataOtherOptionChild ¶
type DataOtherOptionChild struct { //分类1的选项key Sort1 int `db:"sort1" json:"sort1" check:"intThan0" empty:"true"` //分类2的选项key Sort2 int `db:"sort2" json:"sort2" check:"intThan0" empty:"true"` //选项名称 Name string `db:"name" json:"name" check:"name"` //商品ID // 可以给0,则必须声明其他项目内容 ProductID int64 `db:"product_id" json:"productID" check:"id" empty:"true"` //选项key Key string `db:"key" json:"key" check:"mark"` //实际费用 PriceReal int64 `db:"price_real" json:"priceReal" check:"price" empty:"true"` //折扣截止 PriceExpireAt string `db:"price_expire_at" json:"priceExpireAt" check:"isoTime" empty:"true"` //折扣前费用 Price int64 `db:"price" json:"price" check:"price" empty:"true"` //封面ID CoverFileID int64 `db:"cover_file_id" json:"coverFileID" check:"id" empty:"true"` //总库存 Count int `db:"count" json:"count" check:"intThan0" empty:"true"` //商品条形码编码 Code string `db:"code" json:"code"` }
func (*DataOtherOptionChild) Scan ¶
func (t *DataOtherOptionChild) Scan(value interface{}) error
type DataOtherOptionChildList ¶
type DataOtherOptionChildList []DataOtherOptionChild
func (*DataOtherOptionChildList) Scan ¶
func (t *DataOtherOptionChildList) Scan(value interface{}) error
type DataOtherOptionSort ¶
type DataOtherOptionSort struct { //名称 Name string `db:"name" json:"name" check:"name"` //选项组 Options pq.StringArray `db:"options" json:"options"` }
DataOtherOptionSort 分类数据集合
func (*DataOtherOptionSort) Scan ¶
func (t *DataOtherOptionSort) Scan(value interface{}) error
type DataOtherOptions ¶
type DataOtherOptions struct { //分类1 Sort1 DataOtherOptionSort `db:"sort1" json:"sort1"` //分类2 Sort2 DataOtherOptionSort `db:"sort2" json:"sort2"` //数据集合 DataList DataOtherOptionChildList `db:"data_list" json:"dataList"` }
DataOtherOptions 附加选项
func (DataOtherOptions) GetFields ¶
func (t DataOtherOptions) GetFields() (FieldsOtherOption, error)
GetFields 转化数据为数据表结构
func (*DataOtherOptions) Scan ¶
func (t *DataOtherOptions) Scan(value interface{}) error
type FieldsCore ¶
type FieldsCore struct { //ID ID int64 `db:"id" json:"id"` //创建时间 CreateAt time.Time `db:"create_at" json:"createAt"` //更新时间 UpdateAt time.Time `db:"update_at" json:"updateAt"` //删除时间 DeleteAt time.Time `db:"delete_at" json:"deleteAt"` //上级ID // 标记为历史记录,<1为最高级,其他级别代表历史记录 ParentID int64 `db:"parent_id" json:"parentID"` //商品类型 // 0 普通商品; 1 关联选项商品 ProductType int `db:"product_type" json:"productType" check:"intThan0" empty:"true"` //是否为虚拟商品 // 不会发生配送处理 IsVirtual bool `db:"is_virtual" json:"isVirtual" check:"bool"` //组织ID // 留空则表明为平台的用户留下的内容 OrgID int64 `db:"org_id" json:"orgID"` //排序 Sort int `db:"sort" json:"sort"` //发布时间 PublishAt time.Time `db:"publish_at" json:"publishAt"` //分类ID SortID int64 `db:"sort_id" json:"sortID"` //标签ID列 Tags pq.Int64Array `db:"tags" json:"tags"` //商品条形码编码 Code string `db:"code" json:"code"` //标题 Title string `db:"title" json:"title"` //副标题 TitleDes string `db:"title_des" json:"titleDes"` //商品描述 Des string `db:"des" json:"des"` //封面ID CoverFileIDs pq.Int64Array `db:"cover_file_ids" json:"coverFileIDs"` //描述图组 DesFiles pq.Int64Array `db:"des_files" json:"desFiles"` //货币 Currency int `db:"currency" json:"currency"` //实际费用 PriceReal int64 `db:"price_real" json:"priceReal"` //折扣截止 PriceExpireAt time.Time `db:"price_expire_at" json:"priceExpireAt"` //折扣前费用 Price int64 `db:"price" json:"price"` //积分价格 Integral int64 `db:"integral" json:"integral"` //积分最多抵扣费用 IntegralPrice int64 `db:"integral_price" json:"integralPrice"` //积分包含配送费免费 IntegralTransportFree bool `db:"integral_transport_free" json:"integralTransportFree"` //会员价格 // 会员配置分平台和商户,平台会员需参与活动才能使用,否则将禁止设置和后期使用 UserSubPrice FieldsUserSubPrices `db:"user_sub_price" json:"userSubPrice"` //票据 // 可以使用的票据列,具体的配置在票据配置内进行设置 // 票据分平台和商户,平台票据需参与活动才能使用,否则将自动禁止设置和后期使用 UserTicket pq.Int64Array `db:"user_ticket" json:"userTicket"` //配送费计费模版ID TransportID int64 `db:"transport_id" json:"transportID"` //唯一送货地址 Address CoreSQLAddress.FieldsAddress `db:"address" json:"address"` //关联仓库的产品 // ERPProduct模块 WarehouseProductID int64 `db:"warehouse_product_id" json:"warehouseProductID"` //货物重量 // 单位g Weight int `db:"weight" json:"weight"` //总库存 Count int `db:"count" json:"count"` //销量 BuyCount int `db:"buy_count" json:"buyCount"` //关联附加选项 OtherOptions FieldsOtherOption `db:"other_options" json:"otherOptions"` //给与票据列 // 和赠礼区别在于,赠礼不可退,此票据会跟随订单取消设置是否退还 GivingTickets FieldsGivingTickets `db:"giving_tickets" json:"givingTickets"` //扩展参数 Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"` }
FieldsCore 商品核心表
func GetProduct ¶
func GetProduct(args *ArgsGetProduct) (data FieldsCore, err error)
GetProduct 获取指定商品
func GetProductListByWarehouseProductID ¶
func GetProductListByWarehouseProductID(warehouseProductID int64) (dataList []FieldsCore)
GetProductListByWarehouseProductID 通过仓储产品ID获取商品
func GetProductNoErr ¶
func GetProductNoErr(id int64, orgID int64) (data FieldsCore)
func GetProductTop ¶
func GetProductTop(args *ArgsGetProduct) (data FieldsCore, err error)
GetProductTop 是否采用追溯的商品获取产品
type FieldsGivingTicket ¶
type FieldsGivingTicket struct { //票据ID TicketConfigID int64 `db:"ticket_config_id" json:"ticketConfigID" check:"id"` //张数 Count int64 `db:"count" json:"count" check:"int64Than0"` //是否可退 IsRefund bool `db:"is_refund" json:"isRefund" check:"bool"` }
func (*FieldsGivingTicket) Scan ¶
func (t *FieldsGivingTicket) Scan(value interface{}) error
type FieldsGivingTickets ¶
type FieldsGivingTickets []FieldsGivingTicket
FieldsGivingTickets 给与票据
func (*FieldsGivingTickets) Scan ¶
func (t *FieldsGivingTickets) Scan(value interface{}) error
type FieldsOtherOption ¶
type FieldsOtherOption struct { //分类1 Sort1 FieldsOtherOptionSort `db:"sort1" json:"sort1"` //分类2 Sort2 FieldsOtherOptionSort `db:"sort2" json:"sort2"` //数据集合 DataList FieldsOtherOptionChildList `db:"data_list" json:"dataList"` }
FieldsOtherOption 附加选项
func (*FieldsOtherOption) Scan ¶
func (t *FieldsOtherOption) Scan(value interface{}) error
type FieldsOtherOptionChild ¶
type FieldsOtherOptionChild struct { //分类1的选项key Sort1 int `db:"sort1" json:"sort1" check:"intThan0" empty:"true"` //分类2的选项key Sort2 int `db:"sort2" json:"sort2" check:"intThan0" empty:"true"` //商品ID // 可以给0,则必须声明其他项目内容 ProductID int64 `db:"product_id" json:"productID" check:"id" empty:"true"` //选项key Key string `db:"key" json:"key" check:"mark"` //实际费用 PriceReal int64 `db:"price_real" json:"priceReal" check:"price" empty:"true"` //折扣截止 PriceExpireAt time.Time `db:"price_expire_at" json:"priceExpireAt" check:"isoTime" empty:"true"` //折扣前费用 Price int64 `db:"price" json:"price" check:"price" empty:"true"` //封面ID CoverFileID int64 `db:"cover_file_id" json:"coverFileID" check:"id" empty:"true"` //总库存 Count int `db:"count" json:"count" check:"intThan0" empty:"true"` //商品条形码编码 Code string `db:"code" json:"code"` }
func (*FieldsOtherOptionChild) Scan ¶
func (t *FieldsOtherOptionChild) Scan(value interface{}) error
type FieldsOtherOptionChildList ¶
type FieldsOtherOptionChildList []FieldsOtherOptionChild
func (*FieldsOtherOptionChildList) Scan ¶
func (t *FieldsOtherOptionChildList) Scan(value interface{}) error
type FieldsOtherOptionSort ¶
type FieldsOtherOptionSort struct { //名称 Name string `db:"name" json:"name" check:"name"` //选项组 Options pq.StringArray `db:"options" json:"options"` }
FieldsOtherOptionSort 分类数据集合
func (*FieldsOtherOptionSort) Scan ¶
func (t *FieldsOtherOptionSort) Scan(value interface{}) error
type FieldsUserSubPrice ¶
type FieldsUserSubPrice struct { //会员ID ID int64 `db:"id" json:"id"` //标定价格 Price int64 `db:"price" json:"price"` }
FieldsUserSubPrice 会员价格
func (*FieldsUserSubPrice) Scan ¶
func (t *FieldsUserSubPrice) Scan(value interface{}) error
type FieldsUserSubPrices ¶
type FieldsUserSubPrices []FieldsUserSubPrice
func (*FieldsUserSubPrices) Scan ¶
func (t *FieldsUserSubPrices) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.