mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-30 21:10:28 +08:00
实现数据看板--用户
This commit is contained in:
@@ -265,3 +265,11 @@ func (this *UserNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (
|
||||
Param("version", utils.VersionToLong(version)).
|
||||
Count()
|
||||
}
|
||||
|
||||
// CountOfflineNodes 计算离线节点数量
|
||||
func (this *UserNodeDAO) CountOfflineNodes(tx *dbs.Tx) (int64, error) {
|
||||
return this.Query(tx).
|
||||
State(UserNodeStateEnabled).
|
||||
Where("status IS NULL OR JSON_EXTRACT(status, '$.updatedAt')<UNIX_TIMESTAMP()-120").
|
||||
Count()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user