xingzai 7 ماه پیش
والد
کامیت
166f5d6da0
2فایلهای تغییر یافته به همراه88 افزوده شده و 56 حذف شده
  1. 87 55
      controllers/cygx/report_article.go
  2. 1 1
      models/cygx/summary_manage.go

+ 87 - 55
controllers/cygx/report_article.go

@@ -1979,7 +1979,7 @@ func (this *IndustrialSubjectController) ReportMappingAdd() {
 }
 
 //func init() {
-//	initAct()
+//	initart()
 //}
 
 func initart() {
@@ -2277,65 +2277,73 @@ func initart() {
 func initAct() {
 	var condition string
 	mapMobile := make(map[string]bool)
+	mapuserMapbil := make(map[int]*models.WxUserSller)
+	var activityIds []int
+	activityIds = []int{5590, 5658, 5734, 5747, 5805, 5833, 5832, 5865, 5887}
+	var listData []*cygx.UserInteraction
+	for _, vid := range activityIds {
+		activityId := strconv.Itoa(vid)
+
+		//activityId := "5865"
+		//condition = " AND  s.activity_id = " + activityId + "  AND duration != ''  AND  s.create_time < '2024-09-06 09:20'   "
+		//condition = " AND  s.activity_id = " + activityId + "  AND  (is_meeting  = 1  OR   AND duration != '' ) AND  s.create_time < '2024-09-13 10:30'   "
+		//list_H, err := cygx.GetActivityMeetByUser(condition, 0, 1000)
+		//if err != nil && err.Error() != utils.ErrNoRow() {
+		//	fmt.Println(err)
+		//	return
+		//}
+		//
+		//for _, v := range list_H {
+		//	mapMobile[v.Mobile+"_"+activityId] = true
+		//}
 
-	activityId := "5865"
-	//condition = " AND  s.activity_id = " + activityId + "  AND duration != ''  AND  s.create_time < '2024-09-06 09:20'   "
-	condition = " AND  s.activity_id = " + activityId + "  AND is_meeting  = 1  AND  s.create_time < '2024-09-06 09:20'   "
-	list_H, err := cygx.GetActivityMeetByUser(condition, 0, 1000)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		fmt.Println(err)
-		return
-	}
-
-	for _, v := range list_H {
-		mapMobile[v.Mobile] = true
-	}
+		//condition = " AND  s.activity_id = 5833  AND duration != ''   "
+		//condition = " AND  s.activity_id = " + activityId + "  AND duration != ''   " // 2024-09-06 09:20
+		condition = " AND  s.activity_id = " + activityId + "  AND  ( is_meeting  = 1  OR    duration != '' ) AND  s.create_time > '2024-09-13 10:30'   "
+		list, err := cygx.GetActivityMeetByUser(condition, 0, 1000)
+		if err != nil && err.Error() != utils.ErrNoRow() {
+			fmt.Println(err)
+			return
+		}
 
-	//condition = " AND  s.activity_id = 5833  AND duration != ''   "
-	//condition = " AND  s.activity_id = " + activityId + "  AND duration != ''   " // 2024-09-06 09:20
-	condition = " AND  s.activity_id = " + activityId + "  AND is_meeting  = 1 "
-	list, err := cygx.GetActivityMeetByUser(condition, 0, 1000)
-	if err != nil && err.Error() != utils.ErrNoRow() {
-		fmt.Println(err)
-		return
-	}
+		var companyIds []int
+		for _, vuser := range list {
+			//mapuserMapbil[vuser.Mobile] = vuser
+			companyIds = append(companyIds, vuser.CompanyId)
+			listData = append(listData, vuser)
+		}
 
-	var companyIds []int
-	for _, vuser := range list {
-		//mapuserMapbil[vuser.Mobile] = vuser
-		companyIds = append(companyIds, vuser.CompanyId)
-	}
-	mapuserMapbil := make(map[int]*models.WxUserSller)
-	listCompany, err := models.GetWxUserRaiSllerListByUserComapnyId(companyIds)
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
+		listCompany, err := models.GetWxUserRaiSllerListByUserComapnyId(companyIds)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
 
-	//合并合同所对应的权限
-	mappermissionName, err := cygxService.GetCompanyContractPermissionNameMapByIds(companyIds)
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
-	for _, v := range listCompany {
-		v.ChartPermissionName = mappermissionName[v.CompanyId]
-		mapuserMapbil[v.CompanyId] = v
-	}
+		//合并合同所对应的权限
+		mappermissionName, err := cygxService.GetCompanyContractPermissionNameMapByIds(companyIds)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
+		for _, v := range listCompany {
+			v.ChartPermissionName = mappermissionName[v.CompanyId]
+			mapuserMapbil[v.CompanyId] = v
+		}
 
-	listCompanyFicc, err := models.GetWxUserRaiSllerListByUserComapnyIdFicc(companyIds)
-	if err != nil {
-		fmt.Println(err)
-		return
-	}
+		listCompanyFicc, err := models.GetWxUserRaiSllerListByUserComapnyIdFicc(companyIds)
+		if err != nil {
+			fmt.Println(err)
+			return
+		}
 
-	for _, v := range listCompanyFicc {
-		if mapuserMapbil[v.CompanyId] != nil {
-			continue
+		for _, v := range listCompanyFicc {
+			if mapuserMapbil[v.CompanyId] != nil {
+				continue
+			}
+			v.Status = ""
+			v.SellerName = ""
+			mapuserMapbil[v.CompanyId] = v
 		}
-		v.Status = ""
-		v.SellerName = ""
-		mapuserMapbil[v.CompanyId] = v
 	}
 
 	//创建excel
@@ -2376,7 +2384,10 @@ func initAct() {
 	rowTitle := sheet.AddRow()
 
 	cellAct := rowTitle.AddCell()
-	cellAct.Value = "活动名称"
+	cellAct.Value = "活动名称/报告标题"
+
+	cellActime := rowTitle.AddCell()
+	cellActime.Value = " 活动时间/发布时间"
 
 	cellA := rowTitle.AddCell()
 	cellA.Value = "姓名"
@@ -2390,13 +2401,22 @@ func initAct() {
 	cellDfw := rowTitle.AddCell()
 	cellDfw.Value = "服务销售"
 
+	cellYd := rowTitle.AddCell()
+	cellYd.Value = "阅读时间"
+
+	cellstopTime := rowTitle.AddCell()
+	cellstopTime.Value = "停留时长"
+
+	cellLy := rowTitle.AddCell()
+	cellLy.Value = "阅读来源"
+
 	cellStatus := rowTitle.AddCell()
 	cellStatus.Value = "客户状态"
 
 	cellTc := rowTitle.AddCell()
 	cellTc.Value = "签约套餐"
 
-	for _, item := range list {
+	for _, item := range listData {
 		if mapMobile[item.Mobile] {
 			continue
 		}
@@ -2405,6 +2425,9 @@ func initAct() {
 		cellActData := row.AddCell()
 		cellActData.Value = item.ActivityName
 
+		cellActimeData := row.AddCell()
+		cellActimeData.Value = item.ActivityTime
+
 		cellAData := row.AddCell()
 		cellAData.Value = item.RealName
 		//if item.Ly == "1" {
@@ -2418,6 +2441,15 @@ func initAct() {
 		cellDDatafw := row.AddCell()
 		//cellDData.Value = item.SellerName
 
+		cellYdData := row.AddCell()
+		cellYdData.Value = ""
+
+		cellstopTimeData := row.AddCell()
+		cellstopTimeData.Value = ""
+
+		cellLyData := row.AddCell()
+		cellLyData.Value = ""
+
 		cellStatusData := row.AddCell()
 		cellermissionNameData := row.AddCell()
 		if mapuserMapbil[item.CompanyId] != nil {

+ 1 - 1
models/cygx/summary_manage.go

@@ -575,7 +575,7 @@ func GetArticleHistoryList_H(articleId int, condition string) (items []*ArticleH
 				cygx_article_history_record_all AS h
 			WHERE
 				h.article_id = ?
-				AND h.platfor = 1  AND h.is_del = 0  AND h.create_time <'2024-09-05 15:25:00' `
+				AND h.platfor = 1  AND h.is_del = 0  AND h.create_time <'2024-09-13 10:30' `
 	if condition != "" {
 		sql = sql + condition + ` GROUP BY h.id`
 	}