mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 10:05:58 +08:00
errcode
This commit is contained in:
@@ -71,12 +71,6 @@ func (s *Statistics) GetGroupNum(to time.Time) (num int64, err error) {
|
||||
return num, err
|
||||
}
|
||||
|
||||
type ActiveGroup struct {
|
||||
Name string
|
||||
ID string `gorm:"column:recv_id"`
|
||||
MessageNum int `gorm:"column:message_num"`
|
||||
}
|
||||
|
||||
func (s *Statistics) GetActiveGroups(from, to time.Time, limit int) ([]*ActiveGroup, error) {
|
||||
var activeGroups []*ActiveGroup
|
||||
err := s.getChatLogModel().Select("recv_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type in (?)", from, to, []int{constant.GroupChatType, constant.SuperGroupChatType}).Group("recv_id").Limit(limit).Order("message_num DESC").Find(&activeGroups).Error
|
||||
@@ -90,12 +84,6 @@ func (s *Statistics) GetActiveGroups(from, to time.Time, limit int) ([]*ActiveGr
|
||||
return activeGroups, err
|
||||
}
|
||||
|
||||
type ActiveUser struct {
|
||||
Name string
|
||||
ID string `gorm:"column:send_id"`
|
||||
MessageNum int `gorm:"column:message_num"`
|
||||
}
|
||||
|
||||
func (s *Statistics) GetActiveUsers(from, to time.Time, limit int) (activeUsers []*ActiveUser, err error) {
|
||||
err = s.getChatLogModel().Select("send_id, count(*) as message_num").Where("send_time >= ? and send_time <= ? and session_type in (?)", from, to, []int{constant.SingleChatType, constant.GroupChatType, constant.SuperGroupChatType}).Group("send_id").Limit(limit).Order("message_num DESC").Find(&activeUsers).Error
|
||||
for _, activeUser := range activeUsers {
|
||||
|
||||
Reference in New Issue
Block a user