|
@@ -84,6 +84,7 @@ func (ua *UserAnalysis) UnActiveUserLoad(ctx context.Context, start time.Time) (
|
|
|
func (ua *UserAnalysis) ArticleVisit(ctx context.Context, start time.Time) ([]*AnalysisRes, error) {
|
|
|
var (
|
|
|
d1, d2, d3 = map[BaseUserId]bool{}, map[BaseUserId]bool{}, map[BaseUserId]bool{}
|
|
|
+ d4, d5 = map[BaseUserId]bool{}, map[BaseUserId]bool{}
|
|
|
)
|
|
|
|
|
|
rPc, err := g.DB().Query(ctx, `SELECT sum(article) as articleCount,baseUserId FROM pub_tags.user_log_byHour WHERE create_time > ? GROUP BY baseUserId HAVING articleCount >5 `, start.Format(time.DateTime))
|
|
@@ -107,11 +108,19 @@ func (ua *UserAnalysis) ArticleVisit(ctx context.Context, start time.Time) ([]*A
|
|
|
if count >= 10 {
|
|
|
d3[baseUserId] = true
|
|
|
}
|
|
|
+ if count >= 15 {
|
|
|
+ d4[baseUserId] = true
|
|
|
+ }
|
|
|
+ if count >= 20 {
|
|
|
+ d5[baseUserId] = true
|
|
|
+ }
|
|
|
}
|
|
|
return []*AnalysisRes{
|
|
|
{"7天内访问详情页次数>5", "7day_article_gt_5", d1, false},
|
|
|
{"7天内访问详情页次数>=7", "7day_article_gte_7", d2, false},
|
|
|
{"7天内访问详情页次数>=10", "7day_article_gte_10", d3, false},
|
|
|
+ {"7天内访问详情页次数>=15", "7day_article_gte_15", d4, false},
|
|
|
+ {"7天内访问详情页次数>=20", "7day_article_gte_20", d5, false},
|
|
|
}, nil
|
|
|
}
|
|
|
|