Эх сурвалжийг харах

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

zhangchuanxing 3 сар өмнө
parent
commit
7f59a93a98

+ 5 - 1
controllers/report.go

@@ -695,7 +695,11 @@ func (this *ReportController) IndustrialFllow() {
 	item.Source = utils.REGISTER_PLATFORM
 	item.CompanyId = user.CompanyId
 	item.CompanyName = user.CompanyName
-
+	if followType == 3 {
+		item.FollowTypeOrder = -1
+	} else {
+		item.FollowTypeOrder = followType
+	}
 	//if count == 0 {
 	item.Type = 1
 	item.CreateTime = time.Now()

+ 3 - 3
models/industrial_management.go

@@ -3,7 +3,6 @@ package models
 import (
 	"github.com/beego/beego/v2/client/orm"
 	"hongze/hongze_clpt/utils"
-	"strconv"
 	"time"
 )
 
@@ -128,12 +127,13 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
 			re.chart_permission_name,
 			man.new_art_publish_date  AS update_time ,
 			MIN(art.publish_date) AS min_report_time,` + conditionBillboard + `
-		     (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
+		 	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 = 0 
 			WHERE 1= 1
 			AND re.report_type = 2 
 			AND art.is_report = 1
@@ -141,7 +141,7 @@ func GetIndustrialManagementAll(uid int, condition, orderSrt string, startSize,
 			GROUP BY
 			man.industry_name 
 			ORDER BY  follow_type DESC ,  ` + orderSrt + ` LIMIT ?,?`
-	_, err = o.Raw(sql, startSize, pageSize).QueryRows(&items)
+	_, err = o.Raw(sql, uid, startSize, pageSize).QueryRows(&items)
 	return
 }
 

+ 1 - 0
models/industry_fllow.go

@@ -19,6 +19,7 @@ type CygxIndustryFllow struct {
 	RealName               string    `description:"用户实际名称"`
 	Source                 int       `description:"来源1查研观向,2查研观向小助手"`
 	FollowType             int       `description:"1,重点关注,3不感兴趣,0默认接受推送"`
+	FollowTypeOrder        int       `description:"排序方式,重点关注在最前面,不感兴趣在最后面。1,重点关注,-1不感兴趣,0默认接受推送"`
 }
 
 type CygxIndustryFllowRep struct {