From 2ef1435c5edef0d8de6a831986ecaa663eab662e Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 21 Nov 2024 20:04:39 +0800 Subject: [PATCH] update --- app/svc/public_platoon/svc_relation_ship_map.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/svc/public_platoon/svc_relation_ship_map.go b/app/svc/public_platoon/svc_relation_ship_map.go index 2842a18..cef9747 100644 --- a/app/svc/public_platoon/svc_relation_ship_map.go +++ b/app/svc/public_platoon/svc_relation_ship_map.go @@ -171,6 +171,9 @@ func GetSonUserDailyActivity(engine *xorm.Engine, fatherUID int64, startDate, en if err != nil { return 0, nil, zhios_order_relate_logx.Error(err) } + if len(userIDs) == 0 { + return 0, nil, nil + } sql := "SELECT COUNT(*) AS total, uid FROM `egg_energy_user_activity` WHERE uid IN (%s) AND date >= '%s' AND date <= '%s' GROUP BY uid" results, err := db.QueryNativeString(engine, fmt.Sprintf(sql, strings.Join(userIDs, ","), startDate, endDate))