|
@@ -77,12 +77,13 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
|
|
|
man.*,re.chart_permission_name as permission_name,
|
|
|
MAX(art.article_id ) AS article_id,
|
|
|
man.new_art_publish_date AS update_time , MIN(art.publish_date) AS min_report_time,
|
|
|
- (SELECT follow_type_order FROM cygx_industry_fllow AS f WHERE f.user_id = ` + strconv.Itoa(uid) + ` AND f.industrial_management_id = man.industrial_management_id) AS follow_type_order
|
|
|
+ IFNULL( f.follow_type_order, 0 ) AS follow_type_order
|
|
|
FROM
|
|
|
cygx_industrial_management AS man
|
|
|
INNER JOIN cygx_report_mapping AS re ON re.chart_permission_id = man.chart_permission_id
|
|
|
INNER JOIN cygx_industrial_article_group_management AS man_g ON man_g.industrial_management_id = man.industrial_management_id
|
|
|
INNER JOIN cygx_article AS art ON art.article_id = man_g.article_id
|
|
|
+ LEFT JOIN cygx_industry_fllow AS f ON f.industrial_management_id = man.industrial_management_id AND f.user_id = ?
|
|
|
WHERE 1= 1
|
|
|
AND re.report_type = 2
|
|
|
AND art.is_report = 1
|
|
@@ -91,7 +92,7 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
|
|
|
man.industry_name
|
|
|
ORDER BY follow_type_order DESC , ` + orderSrt + ` LIMIT ?,?`
|
|
|
//AND man.industrial_management_id NOT IN ( SELECT industrial_management_id FROM cygx_industry_top WHERE user_id = ` + strconv.Itoa(uid) + ` )
|
|
|
- _, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
|
|
|
+ _, err = o.Raw(sql, uid, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|