实现数据看板--用户

This commit is contained in:
刘祥超
2021-07-11 18:05:57 +08:00
parent 11c344eef4
commit 45e4eb72ac
48 changed files with 564 additions and 300 deletions

View File

@@ -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()
}