|
@@ -509,6 +509,7 @@ type ArticleCollectionResp struct {
|
|
|
SpecialType int `description:"专栏类型 1:笔记,2:观点"`
|
|
|
IndustryTags string `description:"研选专栏行业标签"`
|
|
|
CompanyTags string `description:"研选专栏公司标签"`
|
|
|
+ ArticleTypeName string `description:"文章类型名称"`
|
|
|
}
|
|
|
|
|
|
type IndustrialManagementResp struct {
|
|
@@ -586,6 +587,64 @@ func GetArticleCollectionList(condition string, userId int) (items []*ArticleCol
|
|
|
return
|
|
|
} //end
|
|
|
|
|
|
+// 资源包研选跟研选专栏的搜索
|
|
|
+func GetArticleAndYxSpecialList(condition, conditionSpecial string, userId int) (items []*ArticleCollectionResp, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `SELECT
|
|
|
+ a.article_id,
|
|
|
+ a.title,
|
|
|
+ date_format( a.publish_date, '%Y-%m-%d' ) AS publish_date,
|
|
|
+ d.nick_name,
|
|
|
+ d.department_id,
|
|
|
+ a.article_type_id,
|
|
|
+ 0 AS is_special,
|
|
|
+ "" AS special_tags,
|
|
|
+ "" AS company_tags,
|
|
|
+ "" AS industry_tags,
|
|
|
+ ( SELECT count( 1 ) FROM cygx_article_history_record_newpv AS h WHERE h.article_id = a.article_id ) AS pv,
|
|
|
+ ( SELECT count( 1 ) FROM cygx_article_collect AS ac WHERE ac.article_id = a.article_id ) AS collect_num,
|
|
|
+ ( SELECT count( 1 ) FROM cygx_article_collect AS ac WHERE ac.article_id = a.article_id AND user_id = ? ) AS my_collect_num,
|
|
|
+ '' AS special_type,
|
|
|
+ '' AS user_id,
|
|
|
+ '' AS create_time
|
|
|
+ FROM
|
|
|
+ cygx_article AS a
|
|
|
+ INNER JOIN cygx_industrial_article_group_management AS mg ON mg.article_id = a.article_id
|
|
|
+ INNER JOIN cygx_industrial_management AS m ON m.industrial_management_id = mg.industrial_management_id
|
|
|
+ INNER JOIN cygx_article_department AS d ON d.department_id = a.department_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND a.publish_status = 1 ` + condition + ` GROUP BY article_id
|
|
|
+ UNION ALL
|
|
|
+ SELECT
|
|
|
+ a.id AS article_id,
|
|
|
+ a.title AS title,
|
|
|
+ date_format( a.publish_time, '%Y-%m-%d' ) AS publish_date,
|
|
|
+ "" AS nick_name,
|
|
|
+ 0 AS department_id,
|
|
|
+ - 1 AS article_type_id,
|
|
|
+ 1 AS is_special,
|
|
|
+ a.tags AS special_tags,
|
|
|
+ a.company_tags,
|
|
|
+ a.industry_tags,
|
|
|
+ ( SELECT count( 1 ) FROM cygx_yanxuan_special_record AS h WHERE h.yanxuan_special_id = a.id ) AS pv,
|
|
|
+ ( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id ) AS collect_num,
|
|
|
+ ( SELECT count( 1 ) FROM cygx_yanxuan_special_collect AS ac WHERE ac.yanxuan_special_id = a.id AND user_id = ? ) AS my_collect_num,
|
|
|
+ a.type AS special_type,
|
|
|
+ a.user_id AS user_id,
|
|
|
+ c.create_time AS create_time
|
|
|
+ FROM
|
|
|
+ cygx_yanxuan_special AS a
|
|
|
+ JOIN cygx_yanxuan_special_author AS b ON a.user_id = b.user_id
|
|
|
+ JOIN cygx_yanxuan_special_collect AS c ON a.id = c.yanxuan_special_id
|
|
|
+ WHERE
|
|
|
+ 1 = 1
|
|
|
+ AND a.STATUS = 3 ` + conditionSpecial + ` ORDER BY publish_date DESC LIMIT 30`
|
|
|
+
|
|
|
+ _, err = o.Raw(sql, userId, userId).QueryRows(&items)
|
|
|
+ return
|
|
|
+} //end
|
|
|
+
|
|
|
type ArticleResearchListResp struct {
|
|
|
Paging *paging.PagingItem
|
|
|
List []*ArticleResearchResp
|