上传logo

This commit is contained in:
Hiven
2023-08-02 18:14:53 +08:00
3 changed files with 9 additions and 0 deletions

View File

@@ -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

View File

@@ -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 {