|
@@ -17,9 +17,20 @@ type CygxArticleType struct {
|
|
|
IcoLink string `description:"图标链接地址"`
|
|
|
IcoLinkM string `description:"移动端图标链接地址"`
|
|
|
IsShowLinkButton int `description:"这种报告类型是否展示查看报告链接"`
|
|
|
+ ButtonStyle string `description:"按钮展示样式"`
|
|
|
}
|
|
|
|
|
|
-//详情
|
|
|
+type CygxArticleTypeResp struct {
|
|
|
+ ArticleTypeId int `description:"文章类型ID"`
|
|
|
+ ArticleTypeName string `description:"类型名称"`
|
|
|
+ ButtonStyle string `description:"按钮展示样式"`
|
|
|
+}
|
|
|
+
|
|
|
+type CygxArticleTypeListResp struct {
|
|
|
+ List []CygxArticleTypeResp
|
|
|
+}
|
|
|
+
|
|
|
+// 详情
|
|
|
func GetCygxArticleTypeDetailById(activityTypeId int) (item *CygxArticleType, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_article_type WHERE article_type_id = ? `
|
|
@@ -27,7 +38,7 @@ func GetCygxArticleTypeDetailById(activityTypeId int) (item *CygxArticleType, er
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//获取数量
|
|
|
+// 获取数量
|
|
|
func GetCygxArticleTypeCount(condition string) (count int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sqlCount := `SELECT COUNT(1) AS count FROM cygx_article_type WHERE 1=1 ` + condition
|
|
@@ -35,7 +46,7 @@ func GetCygxArticleTypeCount(condition string) (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//报告类型列表
|
|
|
+// 报告类型列表
|
|
|
func GetCygxArticleTypeList() (items []*CygxArticleType, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_article_type ORDER BY sort DESC`
|
|
@@ -43,6 +54,14 @@ func GetCygxArticleTypeList() (items []*CygxArticleType, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+// 报告类型列表
|
|
|
+func GetCygxArticleTypeListCondition(condition string) (items []*CygxArticleType, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT * FROM cygx_article_type WHERE 1=1 ` + condition + ` ORDER BY sort DESC`
|
|
|
+ _, err = o.Raw(sql).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
func GetArticleTypeInfo(activityTypeId int) (item *CygxArticleType, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `SELECT * FROM cygx_article_type WHERE article_type_id=? `
|