Browse Source

no message

xingzai 1 year ago
parent
commit
5e00738f9b
2 changed files with 29 additions and 11 deletions
  1. 5 5
      controllers/report.go
  2. 24 6
      models/industrial_management.go

+ 5 - 5
controllers/report.go

@@ -286,11 +286,11 @@ func (this *MobileReportController) IndustryList() {
 			condition += ` AND man.industrial_management_id IN (` + utils.GetOrmInReplace(activeIndustryLen) + `)`
 			parsBd = append(parsBd, activeIndustryIds)
 		}
-		nowTime := time.Now().Local()
-		startTime := nowTime.AddDate(0, -1, 0)
-		endTime := nowTime.AddDate(0, 0, -1)
-		condition += ` AND idf.create_time BETWEEN ? AND ?`
-		parsBd = append(parsBd, startTime, endTime)
+		//nowTime := time.Now().Local()
+		//startTime := nowTime.AddDate(0, -1, 0)
+		//endTime := nowTime.AddDate(0, 0, -1)
+		//condition += ` AND idf.create_time BETWEEN ? AND ?`
+		//parsBd = append(parsBd, startTime, endTime)
 		list, e = models.GetTopIndustryFollowData(0, pageSize, condition, parsBd)
 		if e != nil {
 			br.Msg = "获取失败"

+ 24 - 6
models/industrial_management.go

@@ -326,22 +326,40 @@ func GetTopOneMonthArtReadNumIndustryAll(condition string, pars []interface{}) (
 	return
 }
 
+//// GetTopIndustryFollowData 获取关注度最高的产业关注数据
+//func GetTopIndustryFollowData(startSize, pageSize int, condition string, pars []interface{}) (list []*IndustrialManagement, err error) {
+//	sql := `SELECT
+//				COUNT(1) AS one_month_follow_num,
+//				man.*
+//			FROM
+//				cygx_industry_fllow AS idf
+//			JOIN cygx_industrial_management AS man ON idf.industrial_management_id = man.industrial_management_id
+//			WHERE 1 = 1 `
+//	if condition != "" {
+//		sql += condition
+//	}
+//	sql += ` GROUP BY
+//				idf.industrial_management_id
+//			ORDER BY
+//				one_month_follow_num DESC
+//			LIMIT ?,?`
+//	_, err = orm.NewOrm().Raw(sql, pars, startSize, pageSize).QueryRows(&list)
+//	return
+//}
+
 // GetTopIndustryFollowData 获取关注度最高的产业关注数据
 func GetTopIndustryFollowData(startSize, pageSize int, condition string, pars []interface{}) (list []*IndustrialManagement, err error) {
 	sql := `SELECT
-				COUNT(1) AS one_month_follow_num,
 				man.*
-			FROM
-				cygx_industry_fllow AS idf
-			JOIN cygx_industrial_management AS man ON idf.industrial_management_id = man.industrial_management_id
+			FROM  cygx_industrial_management AS man
 			WHERE 1 = 1 `
 	if condition != "" {
 		sql += condition
 	}
 	sql += ` GROUP BY
-				idf.industrial_management_id
+				man.industrial_management_id
 			ORDER BY
-				one_month_follow_num DESC
+				man.one_month_follow_num DESC
 			LIMIT ?,?`
 	_, err = orm.NewOrm().Raw(sql, pars, startSize, pageSize).QueryRows(&list)
 	return