shenjiachi pirms 1 nedēļas
vecāks
revīzija
4de9e62c8f
2 mainītis faili ar 4 papildinājumiem un 19 dzēšanām
  1. +3
    -18
      app/hdl/institutional_management/public_platoon/hdl_basic.go
  2. +1
    -1
      app/svc/public_platoon/svc_relation_ship_map.go

+ 3
- 18
app/hdl/institutional_management/public_platoon/hdl_basic.go Parādīt failu

@@ -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 {


+ 1
- 1
app/svc/public_platoon/svc_relation_ship_map.go Parādīt failu

@@ -171,7 +171,7 @@ func GetSonUserDailyActivity(engine *xorm.Engine, fatherUID int64, startDate, en
return 0, nil, zhios_order_relate_logx.Error(err)
}

sql1 := "SELECT COUNT(*) AS total, uid FROM `egg_enery_user_activity` WHERE uid IN ? AND date > ? AND date < ? GROUP BY uid"
sql1 := "SELECT COUNT(*) AS total, uid FROM `egg_enery_user_activity` WHERE uid IN ? AND date >= ? AND date <= ? GROUP BY uid"
res, err := engine.QueryInterface(sql1, utils.AnyToString(userIDs), startDate, endDate)
if err != nil {
return 0, nil, zhios_order_relate_logx.Error(err)


Notiek ielāde…
Atcelt
Saglabāt