xingzai 7 сар өмнө
parent
commit
ce77d04d57

+ 32 - 15
controllers/cygx/report_article.go

@@ -1979,7 +1979,7 @@ func (this *IndustrialSubjectController) ReportMappingAdd() {
 }
 
 //func init() {
-//	initRsList()
+//	initAct()
 //}
 
 func initart() {
@@ -2045,6 +2045,8 @@ func initart() {
 	cellC.Value = "公司名称"
 	cellD := rowTitle.AddCell()
 	cellD.Value = "所属销售"
+	cellDfw := rowTitle.AddCell()
+	cellDfw.Value = "服务销售"
 
 	cellDCreatedTime := rowTitle.AddCell()
 	cellDCreatedTime.Value = "阅读时间(最后一次)"
@@ -2234,6 +2236,7 @@ func initart() {
 			cellCData := row.AddCell()
 			//cellCData.Value = item.CompanyName
 			cellDData := row.AddCell()
+			cellDDataFw := row.AddCell()
 			//cellDData.Value = item.SellerName
 			cellEData := row.AddCell()
 			cellEData.Value = item.CreateTime
@@ -2257,6 +2260,7 @@ func initart() {
 			if mapuserMapbil[item.Mobile] != nil {
 				cellCData.Value = mapuserMapbil[item.Mobile].CompanyName
 				cellDData.Value = mapuserMapbil[item.Mobile].SellerName
+				cellDDataFw.Value = mapuserMapbil[item.Mobile].ShareSeller
 				cellStatusData.Value = mapuserMapbil[item.Mobile].Status
 				cellermissionNameData.Value = mapuserMapbil[item.Mobile].ChartPermissionName
 			}
@@ -2273,23 +2277,23 @@ func initart() {
 func initAct() {
 	var condition string
 	mapMobile := make(map[string]bool)
-	//condition = " AND  s.activity_id = 5747  AND duration != ''  AND  s.create_time < '2024-08-28 18:00:00'   "
-	//condition = " AND  s.activity_id = 5734  AND is_meeting  = 1  AND  s.create_time < '2024-08-28 18:00:00'   "
-	//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
-	//}
+	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 = 5832  AND duration != ''   " // 2024-09-06 09:20
-	//condition = " AND  s.activity_id = 5805  AND is_meeting  = 1 "
+	//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)
@@ -2370,6 +2374,10 @@ func initAct() {
 	}
 	//标头
 	rowTitle := sheet.AddRow()
+
+	cellAct := rowTitle.AddCell()
+	cellAct.Value = "活动名称"
+
 	cellA := rowTitle.AddCell()
 	cellA.Value = "姓名"
 	cellB := rowTitle.AddCell()
@@ -2379,6 +2387,9 @@ func initAct() {
 	cellD := rowTitle.AddCell()
 	cellD.Value = "所属销售"
 
+	cellDfw := rowTitle.AddCell()
+	cellDfw.Value = "服务销售"
+
 	cellStatus := rowTitle.AddCell()
 	cellStatus.Value = "客户状态"
 
@@ -2390,6 +2401,10 @@ func initAct() {
 			continue
 		}
 		row := sheet.AddRow()
+
+		cellActData := row.AddCell()
+		cellActData.Value = item.ActivityName
+
 		cellAData := row.AddCell()
 		cellAData.Value = item.RealName
 		//if item.Ly == "1" {
@@ -2400,6 +2415,7 @@ func initAct() {
 		cellCData := row.AddCell()
 		//cellCData.Value = item.CompanyName
 		cellDData := row.AddCell()
+		cellDDatafw := row.AddCell()
 		//cellDData.Value = item.SellerName
 
 		cellStatusData := row.AddCell()
@@ -2407,6 +2423,7 @@ func initAct() {
 		if mapuserMapbil[item.CompanyId] != nil {
 			cellCData.Value = mapuserMapbil[item.CompanyId].CompanyName
 			cellDData.Value = mapuserMapbil[item.CompanyId].SellerName
+			cellDDatafw.Value = mapuserMapbil[item.CompanyId].ShareSeller
 			cellStatusData.Value = mapuserMapbil[item.CompanyId].Status
 			cellermissionNameData.Value = mapuserMapbil[item.CompanyId].ChartPermissionName
 		}

+ 1 - 1
models/cygx/report_article.go

@@ -1307,7 +1307,7 @@ func GetCygxCelueArticleHistoryRecordPvAll(articleIds string) (item []*ArticleHi
 
 func GetCygxCelueArticleHistoryRecordPvAll_H(articleIds string) (item []*ArticleHistoryRep, err error) {
 	o := orm.NewOrmUsingDB("hz_cygx")
-	sql := `SELECT * FROM cygx_article_history_record_all as  h WHERE article_id IN ( ` + articleIds + ` )  AND   h.is_del = 0  AND h.company_id != 16   AND h.platfor = 2 AND  h.create_time <'2024-08-28 14:45:00' `
+	sql := `SELECT * FROM cygx_article_history_record_all as  h WHERE article_id IN ( ` + articleIds + ` )  AND   h.is_del = 0  AND h.company_id != 16   AND h.platfor = 2 AND  h.create_time <'2024-09-05 15:25:00' `
 	sql += ` ORDER BY create_time DESC  `
 	_, err = o.Raw(sql).QueryRows(&item)
 	return

+ 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-08-28 14:45:00' `
+				AND h.platfor = 1  AND h.is_del = 0  AND h.create_time <'2024-09-05 15:25:00' `
 	if condition != "" {
 		sql = sql + condition + ` GROUP BY h.id`
 	}

+ 5 - 2
models/wx_user.go

@@ -538,6 +538,7 @@ type WxUserSller struct {
 	SellerName          string `description:"所属销售"`
 	Status              string `description:"所属销售"`
 	ChartPermissionName string `description:"所属销售"`
+	ShareSeller         string `description:"所属销售"`
 }
 
 // GetWxUserRaiSllerListByUserIds 根据用户id获取权益相关用户信息
@@ -579,7 +580,8 @@ func GetWxUserRaiSllerListByUserMobile(mobiles []string) (list []*WxUserSller, e
 				c.company_name,
 				c.company_id,
 				p.status,
-				p.seller_name 
+				p.seller_name,
+				p.share_seller
 			FROM
 				wx_user AS w
 				INNER JOIN company_product AS p ON p.company_id = w.company_id
@@ -627,7 +629,8 @@ func GetWxUserRaiSllerListByUserComapnyId(company_ids []int) (list []*WxUserSlle
 				c.company_name,
 				c.company_id,
 				p.status,
-				p.seller_name 
+				p.seller_name,
+				p.share_seller
 			FROM
 			
 		company_product AS p