|
|
@@ -585,35 +585,20 @@ func UserDailyActivityAnalysis(c *gin.Context) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var activityUserCount int64 |
|
|
|
var activityCount, activityUserCount int64 |
|
|
|
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) |
|
|
|
if err != nil { |
|
|
|
e.OutErr(c, e.ERR_DB_ORM, err.Error()) |
|
|
|
} |
|
|
|
activityCount += tempCount |
|
|
|
activityUserCount++ |
|
|
|
} |
|
|
|
|
|
|
|
topData := md.DailyActivityAnalysisTopData{ |
|
|
|
TeamUserCount: total, |
|
|
|
TeamActivityUserCount: activityUserCount, |
|
|
|
ActivityCount: activityCount, |
|
|
|
TeamActivityUserCount: activityUserCount, |
|
|
|
} |
|
|
|
|
|
|
|
if sons == nil { |
|
|
|