|
@@ -585,35 +585,20 @@ func UserDailyActivityAnalysis(c *gin.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var activityUserCount int64 |
|
|
|
|
|
|
|
|
var activityCount, activityUserCount int64 |
|
|
for _, value := range res1 { |
|
|
for _, value := range res1 { |
|
|
tempCount, err := strconv.ParseInt(fmt.Sprintf("%v", value), 10, 64) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
|
|
} |
|
|
|
|
|
activityUserCount += tempCount |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sql2 := "SELECT COUNT(1) AS total FROM `egg_enery_user_activity` WHERE uid IN (SELECT uid FROM `user_relate` WHERE parent_uid = ?)" |
|
|
|
|
|
res2, err := db.Db.QueryInterface(sql2, parentRelation.Uid) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var activityCount int64 |
|
|
|
|
|
for _, value := range res2 { |
|
|
|
|
|
tempCount, err := strconv.ParseInt(fmt.Sprintf("%v", value), 10, 64) |
|
|
tempCount, err := strconv.ParseInt(fmt.Sprintf("%v", value), 10, 64) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
} |
|
|
} |
|
|
activityCount += tempCount |
|
|
activityCount += tempCount |
|
|
|
|
|
activityUserCount++ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
topData := md.DailyActivityAnalysisTopData{ |
|
|
topData := md.DailyActivityAnalysisTopData{ |
|
|
TeamUserCount: total, |
|
|
TeamUserCount: total, |
|
|
TeamActivityUserCount: activityUserCount, |
|
|
|
|
|
ActivityCount: activityCount, |
|
|
ActivityCount: activityCount, |
|
|
|
|
|
TeamActivityUserCount: activityUserCount, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if sons == nil { |
|
|
if sons == nil { |
|
|