上传logo
This commit is contained in:
@@ -18,6 +18,7 @@ type FsTags struct {
|
||||
Description *string `gorm:"default:'';" json:"description"` // 介绍 Seo
|
||||
RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` //
|
||||
RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` //
|
||||
Category *int64 `gorm:"default:1;" json:"category"` // 分类:1前台用的 2后台用的
|
||||
}
|
||||
type FsTagsModel struct {
|
||||
db *gorm.DB
|
||||
|
||||
@@ -36,6 +36,7 @@ type GetAllTagByParamsReq struct {
|
||||
OrderBy string
|
||||
LevelPrefixLeftLike string //右模糊
|
||||
WithChild bool //是否包含子层级
|
||||
Category int64
|
||||
}
|
||||
|
||||
func (t *FsTagsModel) GetAllTagByParams(ctx context.Context, req GetAllTagByParamsReq) (resp []FsTags, err error) {
|
||||
@@ -46,6 +47,9 @@ func (t *FsTagsModel) GetAllTagByParams(ctx context.Context, req GetAllTagByPara
|
||||
if req.Status != nil {
|
||||
db = db.Where("`status` = ?", *req.Status)
|
||||
}
|
||||
if req.Category != 0 {
|
||||
db = db.Where("`category` = ?", req.Category)
|
||||
}
|
||||
if req.LevelPrefixLeftLike != "" {
|
||||
//查询子集
|
||||
if req.WithChild {
|
||||
|
||||
Reference in New Issue
Block a user