fix
This commit is contained in:
parent
538d9ff4cf
commit
cfc7b22090
25
model/gmodel/fs_merchant_category_gen.go
Normal file
25
model/gmodel/fs_merchant_category_gen.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_merchant_category 商户类型表
|
||||||
|
type FsMerchantCategory struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // Id
|
||||||
|
ZnName *string `gorm:"default:'';" json:"zn_name"` // 中文名
|
||||||
|
EnName *string `gorm:"default:'';" json:"en_name"` // 英文名
|
||||||
|
Icon *string `gorm:"default:'';" json:"icon"` // 图标
|
||||||
|
RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // 推荐商品
|
||||||
|
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
||||||
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态
|
||||||
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
|
}
|
||||||
|
type FsMerchantCategoryModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsMerchantCategoryModel(db *gorm.DB) *FsMerchantCategoryModel {
|
||||||
|
return &FsMerchantCategoryModel{db: db, name: "fs_merchant_category"}
|
||||||
|
}
|
2
model/gmodel/fs_merchant_category_logic.go
Normal file
2
model/gmodel/fs_merchant_category_logic.go
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
package gmodel
|
||||||
|
// TODO: 使用model的属性做你想做的
|
@ -6,10 +6,11 @@ import (
|
|||||||
|
|
||||||
// fs_product_recommend 推荐商品表
|
// fs_product_recommend 推荐商品表
|
||||||
type FsProductRecommend struct {
|
type FsProductRecommend struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品ID
|
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品ID
|
||||||
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0不正常
|
MerchantType *int64 `gorm:"default:0;" json:"merchant_type"` // 商家类型
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0不正常
|
||||||
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
}
|
}
|
||||||
type FsProductRecommendModel struct {
|
type FsProductRecommendModel struct {
|
||||||
db *gorm.DB
|
db *gorm.DB
|
||||||
|
@ -7,9 +7,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type GetRecommendProductListReq struct {
|
type GetRecommendProductListReq struct {
|
||||||
Ctx context.Context
|
Ctx context.Context
|
||||||
Page int
|
MerchantType int64
|
||||||
Limit int
|
Page int
|
||||||
|
Limit int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *FsProductRecommendModel) GetRecommendProductList(req GetRecommendProductListReq) (resp []FsProduct, total int64, err error) {
|
func (r *FsProductRecommendModel) GetRecommendProductList(req GetRecommendProductListReq) (resp []FsProduct, total int64, err error) {
|
||||||
@ -18,6 +19,9 @@ func (r *FsProductRecommendModel) GetRecommendProductList(req GetRecommendProduc
|
|||||||
Joins("inner join fs_product as p on r.product_id = p.id").
|
Joins("inner join fs_product as p on r.product_id = p.id").
|
||||||
Where("r.status = ? ", 1).
|
Where("r.status = ? ", 1).
|
||||||
Where("p.is_shelf = ? and p.is_del = ? and p.status = ?", 1, 0, 1)
|
Where("p.is_shelf = ? and p.is_del = ? and p.status = ?", 1, 0, 1)
|
||||||
|
if req.MerchantType > 0 {
|
||||||
|
db = db.Where("merchant_type = ?", req.MerchantType)
|
||||||
|
}
|
||||||
if err = db.Limit(1).Count(&total).Error; err != nil {
|
if err = db.Limit(1).Count(&total).Error; err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
@ -9,21 +9,21 @@ type FsProductTemplateV2 struct {
|
|||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
|
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
|
||||||
ModelId *int64 `gorm:"default:0;" json:"model_id"` // 模型ID
|
ModelId *int64 `gorm:"default:0;" json:"model_id"` // 模型ID
|
||||||
Title *string `gorm:"default:'';" json:"title"` // 模板(sku),预留字段
|
Title *string `gorm:"default:'';" json:"title"` //
|
||||||
Name *string `gorm:"default:'';" json:"name"` // 名称
|
Name *string `gorm:"default:'';" json:"name"` //
|
||||||
CoverImg *string `gorm:"default:'';" json:"cover_img"` // 模板背景图
|
CoverImg *string `gorm:"default:'';" json:"cover_img"` //
|
||||||
TemplateInfo *string `gorm:"default:'';" json:"template_info"` // 模板详情
|
TemplateInfo *string `gorm:"default:'';" json:"template_info"` //
|
||||||
MaterialImg *string `gorm:"default:'';" json:"material_img"` // 合成好的贴图
|
MaterialImg *string `gorm:"default:'';" json:"material_img"` //
|
||||||
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
|
||||||
LogoWidth *int64 `gorm:"default:0;" json:"logo_width"` // logo图最大宽度
|
LogoWidth *int64 `gorm:"default:0;" json:"logo_width"` // logo图最大宽度
|
||||||
LogoHeight *int64 `gorm:"default:0;" json:"logo_height"` // logo图最大高度
|
LogoHeight *int64 `gorm:"default:0;" json:"logo_height"` // logo图最大高度
|
||||||
IsPublic *int64 `gorm:"default:0;" json:"is_public"` // 是否可公用(1:可以,0:不可以)
|
IsPublic *int64 `gorm:"default:0;" json:"is_public"` // 是否可公用(1:可以,0:不可以)
|
||||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态1正常 2异常
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态1正常 2异常
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
Tag *string `gorm:"default:'';" json:"tag"` // 标签(用户自填)
|
Tag *string `gorm:"default:'';" json:"tag"` //
|
||||||
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除
|
IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除
|
||||||
SwitchInfo *string `gorm:"default:'';" json:"switch_info"` // 开关信息
|
SwitchInfo *string `gorm:"default:'';" json:"switch_info"` //
|
||||||
GroupOptions *string `gorm:"default:'';" json:"group_options"` // 颜色分组
|
GroupOptions *string `gorm:"default:'';" json:"group_options"` //
|
||||||
Version *int64 `gorm:"default:0;" json:"version"` //
|
Version *int64 `gorm:"default:0;" json:"version"` //
|
||||||
}
|
}
|
||||||
type FsProductTemplateV2Model struct {
|
type FsProductTemplateV2Model struct {
|
||||||
|
@ -45,6 +45,7 @@ type AllModelsGen struct {
|
|||||||
FsLog *FsLogModel // fs_log 日志表
|
FsLog *FsLogModel // fs_log 日志表
|
||||||
FsMapLibrary *FsMapLibraryModel // fs_map_library 贴图库
|
FsMapLibrary *FsMapLibraryModel // fs_map_library 贴图库
|
||||||
FsMenu *FsMenuModel // fs_menu 后台菜单
|
FsMenu *FsMenuModel // fs_menu 后台菜单
|
||||||
|
FsMerchantCategory *FsMerchantCategoryModel // fs_merchant_category 商户类型表
|
||||||
FsMigration *FsMigrationModel // fs_migration 版本库
|
FsMigration *FsMigrationModel // fs_migration 版本库
|
||||||
FsOrder *FsOrderModel // fs_order
|
FsOrder *FsOrderModel // fs_order
|
||||||
FsOrderAffiliate *FsOrderAffiliateModel // fs_order_affiliate 订单附属表-流程控制时间等
|
FsOrderAffiliate *FsOrderAffiliateModel // fs_order_affiliate 订单附属表-流程控制时间等
|
||||||
@ -140,6 +141,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsLog: NewFsLogModel(gdb),
|
FsLog: NewFsLogModel(gdb),
|
||||||
FsMapLibrary: NewFsMapLibraryModel(gdb),
|
FsMapLibrary: NewFsMapLibraryModel(gdb),
|
||||||
FsMenu: NewFsMenuModel(gdb),
|
FsMenu: NewFsMenuModel(gdb),
|
||||||
|
FsMerchantCategory: NewFsMerchantCategoryModel(gdb),
|
||||||
FsMigration: NewFsMigrationModel(gdb),
|
FsMigration: NewFsMigrationModel(gdb),
|
||||||
FsOrder: NewFsOrderModel(gdb),
|
FsOrder: NewFsOrderModel(gdb),
|
||||||
FsOrderAffiliate: NewFsOrderAffiliateModel(gdb),
|
FsOrderAffiliate: NewFsOrderAffiliateModel(gdb),
|
||||||
|
@ -54,9 +54,10 @@ func (l *HomePageRecommendProductListLogic) HomePageRecommendProductList(req *ty
|
|||||||
)
|
)
|
||||||
//获取列表推荐产品
|
//获取列表推荐产品
|
||||||
recommendProductList, _, err = l.svcCtx.AllModels.FsProductRecommend.GetRecommendProductList(gmodel.GetRecommendProductListReq{
|
recommendProductList, _, err = l.svcCtx.AllModels.FsProductRecommend.GetRecommendProductList(gmodel.GetRecommendProductListReq{
|
||||||
Ctx: l.ctx,
|
Ctx: l.ctx,
|
||||||
Page: 1,
|
MerchantType: req.MerchantType,
|
||||||
Limit: 500, //设置最大500
|
Page: 1,
|
||||||
|
Limit: 500, //设置最大500
|
||||||
})
|
})
|
||||||
if len(recommendProductList) == 0 {
|
if len(recommendProductList) == 0 {
|
||||||
return resp.SetStatusWithMessage(basic.CodeOK, "success", []interface{}{})
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", []interface{}{})
|
||||||
|
@ -342,12 +342,6 @@ type GetSizeByPidRsp struct {
|
|||||||
type GetTemplateByPidReq struct {
|
type GetTemplateByPidReq struct {
|
||||||
Pid string `form:"pid"`
|
Pid string `form:"pid"`
|
||||||
ProductTemplateTagId int64 `form:"product_template_tag_id"`
|
ProductTemplateTagId int64 `form:"product_template_tag_id"`
|
||||||
ProductSizeId int64 `form:"product_size_id,optional"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type GetTemplateByPidRsp struct {
|
|
||||||
TemplateId int64 `json:"template_id"` //模板id
|
|
||||||
TemplateInfo interface{} `json:"template_info"` //模板信息
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetFittingByPidReq struct {
|
type GetFittingByPidReq struct {
|
||||||
@ -395,7 +389,8 @@ type GetLastProductDesignRsp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type HomePageRecommendProductListReq struct {
|
type HomePageRecommendProductListReq struct {
|
||||||
Size uint32 `form:"size"`
|
Size uint32 `form:"size"`
|
||||||
|
MerchantType int64 `form:"merchant_type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type HomePageRecommendProductListRsp struct {
|
type HomePageRecommendProductListRsp struct {
|
||||||
|
@ -432,7 +432,8 @@ type GetLastProductDesignRsp {
|
|||||||
}
|
}
|
||||||
//获取列表页推荐产品(返回是这个维度数组)
|
//获取列表页推荐产品(返回是这个维度数组)
|
||||||
type HomePageRecommendProductListReq {
|
type HomePageRecommendProductListReq {
|
||||||
Size uint32 `form:"size"`
|
Size uint32 `form:"size"`
|
||||||
|
MerchantType int64 `form:"merchant_type"`
|
||||||
}
|
}
|
||||||
type HomePageRecommendProductListRsp {
|
type HomePageRecommendProductListRsp {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user