mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-29 11:30:24 +08:00
实现用户dashboard统计
This commit is contained in:
@@ -464,7 +464,7 @@ func (this *ServerDAO) UpdateServerReverseProxy(serverId int64, config []byte) e
|
||||
}
|
||||
|
||||
// 计算所有可用服务数量
|
||||
func (this *ServerDAO) CountAllEnabledServersMatch(groupId int64, keyword string) (int64, error) {
|
||||
func (this *ServerDAO) CountAllEnabledServersMatch(groupId int64, keyword string, userId int64) (int64, error) {
|
||||
query := this.Query().
|
||||
State(ServerStateEnabled)
|
||||
if groupId > 0 {
|
||||
@@ -475,6 +475,9 @@ func (this *ServerDAO) CountAllEnabledServersMatch(groupId int64, keyword string
|
||||
query.Where("(name LIKE :keyword OR serverNames LIKE :keyword)").
|
||||
Param("keyword", "%"+keyword+"%")
|
||||
}
|
||||
if userId > 0{
|
||||
query.Attr("userId", userId)
|
||||
}
|
||||
return query.Count()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user