Bladeren bron

Merge branch 'cygx/cygx_14.0' of http://8.136.199.33:3000/hongze/hongze_cygx into debug

zhangchuanxing 3 maanden geleden
bovenliggende
commit
a610db9a3d
1 gewijzigde bestanden met toevoegingen van 3 en 4 verwijderingen
  1. 3 4
      models/industrial_management.go

+ 3 - 4
models/industrial_management.go

@@ -76,9 +76,8 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
 	sql := `SELECT
 			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 COUNT( 1 ) FROM cygx_article_history_record AS rec WHERE rec.user_id = ` + strconv.Itoa(uid) + ` AND rec.article_id = art.article_id ) AS readnum ,
-		    (SELECT COUNT( 1 )  FROM cygx_industry_fllow AS f WHERE f.user_id = ` + strconv.Itoa(uid) + ` AND f.industrial_management_id = man.industrial_management_id AND f.type = 1) AS is_follow
+           	man.new_art_publish_date AS update_time , MIN(art.publish_date) AS min_report_time,
+		    (SELECT follow_type  FROM cygx_industry_fllow AS f WHERE f.user_id = ` + strconv.Itoa(uid) + ` AND f.follow_type = 1 AND  f.industrial_management_id = man.industrial_management_id) AS follow_type 
 			FROM
 			cygx_industrial_management AS man
 			INNER JOIN cygx_report_mapping AS re ON re.chart_permission_id = man.chart_permission_id
@@ -90,7 +89,7 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
 			AND art.is_class = 1 ` + condition + `
 			GROUP BY
 			man.industry_name 
-			ORDER BY ` + orderSrt + ` LIMIT ?,?`
+			ORDER BY  follow_type 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)
 	return