mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	部分API支持用户平台调用
This commit is contained in:
		@@ -1262,9 +1262,13 @@ func (this *ServerDAO) CountAllEnabledServersWithNodeClusterId(tx *dbs.Tx, clust
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CountAllEnabledServersWithGroupId 计算使用某个分组的服务数量
 | 
			
		||||
func (this *ServerDAO) CountAllEnabledServersWithGroupId(tx *dbs.Tx, groupId int64) (int64, error) {
 | 
			
		||||
	return this.Query(tx).
 | 
			
		||||
		State(ServerStateEnabled).
 | 
			
		||||
func (this *ServerDAO) CountAllEnabledServersWithGroupId(tx *dbs.Tx, groupId int64, userId int64) (int64, error) {
 | 
			
		||||
	var query = this.Query(tx).
 | 
			
		||||
		State(ServerStateEnabled)
 | 
			
		||||
	if userId > 0 {
 | 
			
		||||
		query.Attr("userId", userId)
 | 
			
		||||
	}
 | 
			
		||||
	return query.
 | 
			
		||||
		Where("JSON_CONTAINS(groupIds, :groupId)").
 | 
			
		||||
		Param("groupId", numberutils.FormatInt64(groupId)).
 | 
			
		||||
		Count()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user