Bladeren bron

Merge branch 'cygx_10.9' into debug

# Conflicts:
#	models/report.go
ziwen 1 jaar geleden
bovenliggende
commit
f18ec519d7
3 gewijzigde bestanden met toevoegingen van 41 en 15 verwijderingen
  1. 15 0
      controllers/activity_special.go
  2. 17 2
      models/report.go
  3. 9 13
      services/activity.go

+ 15 - 0
controllers/activity_special.go

@@ -284,6 +284,21 @@ func (this *ActivitySpecialController) SpecialTripAdd() {
 				if sellerItem != nil {
 					item.SellerName = sellerItem.RealName
 				}
+				if user.OutboundMobile != "" {
+					item.OutboundMobile = user.OutboundMobile
+					if user.OutboundCountryCode == "" {
+						item.CountryCode = "86"
+					} else {
+						item.CountryCode = user.OutboundCountryCode
+					}
+				} else {
+					item.OutboundMobile = user.Mobile
+					if user.CountryCode == "" {
+						item.CountryCode = "86"
+					} else {
+						item.CountryCode = user.CountryCode
+					}
+				}
 				err = models.AddCygxActivitySpecialTrip(item)
 				if err != nil {
 					br.Msg = "操作失败"

+ 17 - 2
models/report.go

@@ -601,7 +601,7 @@ type TimeLineReportItem struct {
 	SubCategoryName string `description:"二级分类"`
 	IsRed           bool   `description:"是否标红"`
 	Readnum         int    `description:"阅读数量"`
-	Resource        int    `description:"来源类型,1:文章、2:产品内测、3:晨报点评"`
+	Resource        int    `description:"来源类型,1:文章、2:产品内测、3:晨报点评 4:活动回放"`
 }
 
 // 获取产业报告+晨会点评列表
@@ -661,7 +661,22 @@ FROM
 	WHERE
 		p.product_interior_id = pm.product_interior_id 
 		AND p.visible_range = 1 
-		AND pm.industrial_management_id = ? 
+		AND pm.industrial_management_id = ? UNION ALL
+ 	SELECT 
+		ca.activity_id AS id,
+		cav.video_name AS title,
+		ca.activity_time AS publish_time,
+		cav.video_url AS video_url,
+		'' AS sub_category_name,
+		'' AS content,
+		4 AS resource,
+		( SELECT COUNT( 1 ) FROM cygx_activity_video_history AS rec WHERE rec.user_id = ` + strconv.Itoa(userId) + ` AND rec.activity_id = ca.activity_id ) AS readnum 
+	FROM 
+		cygx_activity AS ca 
+		INNER JOIN cygx_activity_video AS cav ON ca.activity_id = cav.activity_id 
+		INNER JOIN cygx_industrial_activity_group_management AS cam ON ca.activity_id=cam.activity_id
+	WHERE 
+		cam.industrial_management_id = ? AND cam.source = 1
 	) AS t`
 	totalSql := `SELECT COUNT(1) total FROM (` + sql + `) z `
 	err = o.Raw(totalSql, industrialManagementId, industrialManagementId, industrialManagementId).QueryRow(&total)

+ 9 - 13
services/activity.go

@@ -889,20 +889,16 @@ func GetActivityNewLabelMap(activityIds []int) (labelMap map[int]bool, industryN
 			}
 		}
 	}
-
-	//for _, v := range activityIds {
-	//	labelMap[v] = true
+	//
+	//////产业关联的弘则报告发布日期在三个月以内的活动、产业显示 NEW标签
+	//articNewLabel, e := GetArticNewLabelWhithActivity3Month()
+	//if e != nil {
+	//	err = errors.New("获取产业新标签Map失败, Err: " + e.Error())
+	//	return
+	//}
+	//for k := range articNewLabel {
+	//	labelMap[k] = true
 	//}
-	//fmt.Println(labelMap)
-	////产业关联的弘则报告发布日期在三个月以内的活动、产业显示 NEW标签
-	articNewLabel, e := GetArticNewLabelWhithActivity3Month()
-	if e != nil {
-		err = errors.New("获取产业新标签Map失败, Err: " + e.Error())
-		return
-	}
-	for k := range articNewLabel {
-		labelMap[k] = true
-	}
 	return
 }