wangkaiyue 9 달 전
부모
커밋
a3e31a6e88
3개의 변경된 파일28개의 추가작업 그리고 9개의 파일을 삭제
  1. 2 2
      userSign/main.go
  2. 19 0
      userSign/new.sql
  3. 7 7
      userSign/userAnalysis/jobMgoUserRange.go

+ 2 - 2
userSign/main.go

@@ -35,13 +35,13 @@ func runOnce(ctx context.Context) {
 	//活跃用户分析
 	for _, source := range sourceArr {
 		if res, err := manager.ActiveUserLoad(ctx, nowTime.AddDate(0, 0, -30), source); err == nil && len(res) > 0 {
-			allRes = append(allRes, &userAnalysis.AnalysisRes{Name: fmt.Sprintf("30天%s活跃用户", source), Code: fmt.Sprintf("active-%s-%d", source, 30), Data: res})
+			allRes = append(allRes, &userAnalysis.AnalysisRes{Name: fmt.Sprintf("30天%s活跃用户", source), Code: fmt.Sprintf("active_%s_%d", source, 30), Data: res})
 		}
 	}
 	//未活跃用户占比
 	for _, day := range unActiveTime {
 		if res, err := manager.UnActiveUserLoad(ctx, nowTime.AddDate(0, 0, -day)); err == nil && len(res) > 0 {
-			allRes = append(allRes, &userAnalysis.AnalysisRes{Name: fmt.Sprintf("%d天未活跃用户", day), Code: "hasPay", Data: res})
+			allRes = append(allRes, &userAnalysis.AnalysisRes{Name: fmt.Sprintf("%d天未活跃用户", day), Code: "unActive_%d", Data: res})
 		}
 	}
 

+ 19 - 0
userSign/new.sql

@@ -0,0 +1,19 @@
+
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2000, 'binPhone', '已绑定手机号',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2000);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2001, 'bindMail', '已绑定邮箱',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2001);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2002, 'vip', '超级订阅',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2002);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2003, 'vipExpire_15', '超级订阅15天到期',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2003);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2004, 'vipExpire_30', '超级订阅30天到期',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2004);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2005, 'member', '大会员用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2005);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2006, 'memberExpired', '曾购大会员用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2006);
+
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2007, 'hasPay', '付费用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2007);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2008, 'unBuyVipMonth', '本月加购未购超级订阅',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2008);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2009, 'unBuyMemberMonth', '本月加购未购大会员',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2009);
+
+
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2010, 'active_pc', '30天pc活跃用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2010);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2011, 'active_wx', '30天wx活跃用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2011);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2012, 'active_app', '30天app活跃用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2012);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2013, 'unActive_30', '30天未活跃用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2013);
+INSERT INTO pub_tags.dwd_d_tag (id, code, name, bitobj, groupid, created_at, created_by, bit_num) VALUES(2014, 'unActive_90', '90天未活跃用户',bitmapBuild([toUInt64(0)]) , 2, '2024-10-21 00:00:00', 'wky', 2014);

+ 7 - 7
userSign/userAnalysis/jobMgoUserRange.go

@@ -16,13 +16,13 @@ func (ua *UserAnalysis) GetMgoUserRes(ctx context.Context) ([]*AnalysisRes, erro
 	ua.mgoUserRange(ctx)
 	ua.mgoEntUserRange(ctx)
 	return []*AnalysisRes{
-			{Name: "已绑定手机号用户", Code: "BinPhone", Data: ua.BinPhone},
-			{Name: "已绑定邮箱用户", Code: "BindMail", Data: ua.BindMail},
-			{Name: "超级订阅用户", Code: "Vip", Data: ua.Vip},
-			{Name: "超级订阅15天到期用户", Code: "Vip15", Data: ua.Vip15},
-			{Name: "超级订阅30天到期用户", Code: "Vip30", Data: ua.Vip30},
-			{Name: "大会员用户", Code: "Member", Data: ua.Member},
-			{Name: "曾购大会员用户", Code: "MemberExpire", Data: ua.MemberExpire}},
+			{Name: "已绑定手机号用户", Code: "binPhone", Data: ua.BinPhone},
+			{Name: "已绑定邮箱用户", Code: "bindMail", Data: ua.BindMail},
+			{Name: "超级订阅用户", Code: "vip", Data: ua.Vip},
+			{Name: "超级订阅15天到期", Code: "vipExpire_15", Data: ua.Vip15},
+			{Name: "超级订阅30天到期", Code: "vipExpire_30", Data: ua.Vip30},
+			{Name: "大会员用户", Code: "member", Data: ua.Member},
+			{Name: "曾购大会员用户", Code: "memberExpired", Data: ua.MemberExpire}},
 		nil
 }