|
@@ -175,31 +175,33 @@ func FindByIdClassify(classifyId int) (item *Classify, err error) {
|
|
|
}
|
|
|
|
|
|
type ClassifyList struct {
|
|
|
- Id int `orm:"column(id);pk"`
|
|
|
- ClassifyName string `description:"分类名称"`
|
|
|
- Sort int `description:"排序"`
|
|
|
- ParentId int `description:"父级分类id"`
|
|
|
- CreateTime time.Time `description:"创建时间"`
|
|
|
- ModifyTime time.Time `description:"修改时间"`
|
|
|
- Abstract string `description:"简介"`
|
|
|
- Descript string `description:"描述"`
|
|
|
- ClassifyLabel string `description:"分类标签"`
|
|
|
- ShowType int `description:"展示类型:1-列表 2-专栏"`
|
|
|
- HasTeleconference int `description:"是否有电话会:0-否 1-是"`
|
|
|
- IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
|
|
|
- YbFiccSort int `description:"小程序FICC页排序"`
|
|
|
- YbFiccIcon string `description:"小程序FICC页icon"`
|
|
|
- YbFiccPcIcon string `description:"小程序PC端FICC页背景图"`
|
|
|
- YbIconUrl string `description:"小程序已购页icon"`
|
|
|
- YbBgUrl string `description:"小程序已购详情背景图"`
|
|
|
- YbListImg string `description:"小程序研报列表封面图"`
|
|
|
- YbShareBgImg string `description:"小程序研报详情分享背景图"`
|
|
|
- YbRightBanner string `description:"Pc端详情页,右侧,报告合集背景图"`
|
|
|
- RelateTel int `description:"是否在电话会中可选: 0-否; 1-是"`
|
|
|
- RelateVideo int `description:"是否在路演视频中可选: 0-否; 1-是"`
|
|
|
- Enabled int `description:"是否可用,1可用,0禁用"`
|
|
|
- Child []*ClassifyItem
|
|
|
- ClassifyMenuList []*ClassifyMenu
|
|
|
+ Id int `orm:"column(id);pk"`
|
|
|
+ ClassifyName string `description:"分类名称"`
|
|
|
+ Sort int `description:"排序"`
|
|
|
+ ParentId int `description:"父级分类id"`
|
|
|
+ CreateTime time.Time `description:"创建时间"`
|
|
|
+ ModifyTime time.Time `description:"修改时间"`
|
|
|
+ Abstract string `description:"简介"`
|
|
|
+ Descript string `description:"描述"`
|
|
|
+ ClassifyLabel string `description:"分类标签"`
|
|
|
+ ShowType int `description:"展示类型:1-列表 2-专栏"`
|
|
|
+ HasTeleconference int `description:"是否有电话会:0-否 1-是"`
|
|
|
+ IsShow int `description:"是否在小程序显示:1-显示 0-隐藏"`
|
|
|
+ YbFiccSort int `description:"小程序FICC页排序"`
|
|
|
+ YbFiccIcon string `description:"小程序FICC页icon"`
|
|
|
+ YbFiccPcIcon string `description:"小程序PC端FICC页背景图"`
|
|
|
+ YbIconUrl string `description:"小程序已购页icon"`
|
|
|
+ YbBgUrl string `description:"小程序已购详情背景图"`
|
|
|
+ YbListImg string `description:"小程序研报列表封面图"`
|
|
|
+ YbShareBgImg string `description:"小程序研报详情分享背景图"`
|
|
|
+ YbRightBanner string `description:"Pc端详情页,右侧,报告合集背景图"`
|
|
|
+ RelateTel int `description:"是否在电话会中可选: 0-否; 1-是"`
|
|
|
+ RelateVideo int `description:"是否在路演视频中可选: 0-否; 1-是"`
|
|
|
+ Enabled int `description:"是否可用,1可用,0禁用"`
|
|
|
+ Child []*ClassifyList
|
|
|
+ ClassifyMenuId int `description:"二级分类-子目录ID"`
|
|
|
+ ClassifyMenuList []*ClassifyMenu
|
|
|
+ ChartPermissionIdList []int `description:"绑定的权限ID"`
|
|
|
}
|
|
|
|
|
|
type ClassifyItem struct {
|
|
@@ -220,14 +222,9 @@ type ClassifyPermissionListResp struct {
|
|
|
}
|
|
|
|
|
|
// 获取分类列表
|
|
|
-func GetClassifyList(keyWord, companyType string, hideDayWeek, enabled int) (items []*ClassifyList, err error) {
|
|
|
+func GetClassifyList(keyWord string, enabled int) (items []*ClassifyList, err error) {
|
|
|
sql := ``
|
|
|
companyTypeSqlStr := ``
|
|
|
- if companyType == "ficc" {
|
|
|
- companyTypeSqlStr = " AND id != 40 AND parent_id != 40 "
|
|
|
- } else if companyType == "权益" {
|
|
|
- companyTypeSqlStr = " AND (id = 40 or parent_id = 40) "
|
|
|
- }
|
|
|
if enabled == 1 {
|
|
|
companyTypeSqlStr += ` AND enabled = 1 `
|
|
|
}
|
|
@@ -245,9 +242,6 @@ func GetClassifyList(keyWord, companyType string, hideDayWeek, enabled int) (ite
|
|
|
pars = utils.GetLikeKeywordPars(pars, keyWord, 2)
|
|
|
} else {
|
|
|
sql = `SELECT * FROM classify WHERE parent_id=0 ` + companyTypeSqlStr
|
|
|
- if hideDayWeek == 1 {
|
|
|
- sql += ` AND classify_name <> '晨报' AND classify_name <> '周报' `
|
|
|
- }
|
|
|
|
|
|
sql += ` ORDER BY sort ASC, create_time ASC`
|
|
|
}
|
|
@@ -510,3 +504,51 @@ func GetCountClassifyChildByParentId(parentId int) (total int, err error) {
|
|
|
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetClassifyListByKeyword
|
|
|
+// @Description: 获取分类列表
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-06-19 09:49:33
|
|
|
+// @param keyWord string
|
|
|
+// @param enabled int
|
|
|
+// @return items []*ClassifyList
|
|
|
+// @return err error
|
|
|
+func GetClassifyListByKeyword(keyWord string, enabled int) (items []*ClassifyList, err error) {
|
|
|
+ sql := ``
|
|
|
+ pars := make([]interface{}, 0)
|
|
|
+
|
|
|
+ sql = `SELECT * FROM classify WHERE 1=1 `
|
|
|
+ if enabled == 1 {
|
|
|
+ sql += ` AND enabled = 1 `
|
|
|
+ }
|
|
|
+
|
|
|
+ if keyWord != `` {
|
|
|
+ sql += ` classify_name LIKE ? `
|
|
|
+ pars = utils.GetLikeKeywordPars(pars, keyWord, 1)
|
|
|
+ }
|
|
|
+ sql += ` ORDER BY sort ASC, create_time ASC`
|
|
|
+
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ _, err = o.Raw(sql, pars...).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+// GetClassifyListByKeyword
|
|
|
+// @Description: 获取分类列表
|
|
|
+// @author: Roc
|
|
|
+// @datetime 2024-06-19 09:49:33
|
|
|
+// @param keyWord string
|
|
|
+// @param enabled int
|
|
|
+// @return items []*ClassifyList
|
|
|
+// @return err error
|
|
|
+func GetClassifyListByParentIdList(parentClassifyIdList []int) (items []*ClassifyList, err error) {
|
|
|
+ num := len(parentClassifyIdList)
|
|
|
+ if num <= 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ sql := `SELECT * FROM classify WHERE id in (` + utils.GetOrmInReplace(num) + `) ORDER BY sort ASC, create_time ASC`
|
|
|
+
|
|
|
+ o := orm.NewOrmUsingDB("rddp")
|
|
|
+ _, err = o.Raw(sql, parentClassifyIdList).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|