|
@@ -28,3 +28,50 @@ type AddCygxActivityHelpAsk struct {
|
|
|
ActivityId int `description:"活动id"`
|
|
|
Content string `description:"内容"`
|
|
|
}
|
|
|
+
|
|
|
+type CygxAskList struct {
|
|
|
+ ReportOrActivityId int ` description:"对应的文章或者活动Id"`
|
|
|
+ Title string `description:"标题"`
|
|
|
+ Content string `description:"内容"`
|
|
|
+ AskType string `description:"类型 Activity 活动 、Report 文章报告"`
|
|
|
+}
|
|
|
+
|
|
|
+type CygxAskListResp struct {
|
|
|
+ List []*CygxAskList
|
|
|
+}
|
|
|
+
|
|
|
+//report_or_activity_id
|
|
|
+
|
|
|
+//主题列表
|
|
|
+func GetActivityAskList(userId int) (items []*CygxAskList, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ k.activity_id as report_or_activity_id,
|
|
|
+ k.content,
|
|
|
+ k.create_time,
|
|
|
+ a.activity_name as title
|
|
|
+ FROM
|
|
|
+ cygx_activity_help_ask AS k
|
|
|
+ INNER JOIN cygx_activity AS a ON a.activity_id = k.activity_id
|
|
|
+ WHERE
|
|
|
+ user_id = ? ORDER BY k.ask_id DESC`
|
|
|
+ _, err = o.Raw(sql, userId).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+//列表
|
|
|
+func GetArticleAskList(userId int) (items []*CygxAskList, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ k.article_id as report_or_activity_id,
|
|
|
+ k.content,
|
|
|
+ k.create_time,
|
|
|
+ a.title as title
|
|
|
+ FROM
|
|
|
+ cygx_article_ask AS k
|
|
|
+ INNER JOIN cygx_article AS a ON a.article_id = k.article_id
|
|
|
+ WHERE
|
|
|
+ user_id = ? ORDER BY k.ask_id DESC`
|
|
|
+ _, err = o.Raw(sql, userId).QueryRows(&items)
|
|
|
+ return
|
|
|
+}
|