Browse Source

fix: 活动产业资源包

hsun 2 years ago
parent
commit
03efa3309c
3 changed files with 5 additions and 4 deletions
  1. 2 1
      controllers/activity.go
  2. 1 1
      models/industrial_management.go
  3. 2 2
      services/industrial_management.go

+ 2 - 1
controllers/activity.go

@@ -3007,8 +3007,9 @@ func (this *ActivityCoAntroller) ActivityListNew() {
 		if sourceIndustry != nil {
 			resp.IndustrialManagementId = sourceIndustry.IndustrialManagementId
 			resp.IsJump = true
+			// 研选产业不跳资源包
 			if sourceIndustry.ChartPermissionId == utils.CHART_PERMISSION_ID_YANXUAN {
-				resp.IsResearch = true
+				resp.IsJump = false
 			}
 			// 产业新标签
 			industryIds := []int{sourceIndustry.IndustrialManagementId}

+ 1 - 1
models/industrial_management.go

@@ -607,7 +607,7 @@ func GetSourceIndustryByName(industryName string) (item *IndustrialManagement, e
 			INNER JOIN cygx_industrial_article_group_management AS mg ON mg.industrial_management_id = m.industrial_management_id
 			INNER JOIN cygx_article AS a ON a.article_id = mg.article_id AND a.article_type != 'lyjh'
 			WHERE
-				1 = 1 AND m.industry_name = ? AND a.publish_status = 1
+				1 = 1 AND m.industry_name = ? AND a.publish_status = 1 AND a.category_name != "买方研选"
 			GROUP BY
 				m.industrial_management_id`
 	err = orm.NewOrm().Raw(sql, industryName).QueryRow(&item)

+ 2 - 2
services/industrial_management.go

@@ -242,10 +242,10 @@ func GetIndustryNewLabelMap(industryIds []int) (labelMap map[int]bool, err error
 	// 判断产业是否为新
 	nowTime := time.Now().Local()
 	threeMonthBefore := nowTime.AddDate(0, -3, 0)
-	nullTime, _ := time.Parse(utils.FormatDateTime, "0001-01-01 00:00:00")
+	nullTime, _ := time.ParseInLocation(utils.FormatDateTime, "0001-01-01 00:00:00", time.Local)
 	for i := range industryTimeList {
 		// 最早发布时间为空 / 最早发布时间在三个月前之后
-		if industryTimeList[i].MinPublishTime == nullTime || (industryTimeList[i].MinPublishTime.After(threeMonthBefore)) {
+		if industryTimeList[i].MinPublishTime.Equal(nullTime) || (industryTimeList[i].MinPublishTime.After(threeMonthBefore)) {
 			labelMap[industryTimeList[i].IndustrialManagementId] = true
 		}
 	}