data management page shows all user data statistics

This commit is contained in:
MaysWind
2023-04-02 19:13:33 +08:00
parent dfb6c593e4
commit 3b0ef7a96d
13 changed files with 174 additions and 1 deletions
+11
View File
@@ -30,6 +30,17 @@ var (
}
)
// GetTotalAccountCountByUid returns total account count of user
func (s *AccountService) GetTotalAccountCountByUid(uid int64) (int64, error) {
if uid <= 0 {
return 0, errs.ErrUserIdInvalid
}
count, err := s.UserDataDB(uid).Where("uid=? AND deleted=?", uid, false).Count(&models.Account{})
return count, err
}
// GetAllAccountsByUid returns all account models of user
func (s *AccountService) GetAllAccountsByUid(uid int64) ([]*models.Account, error) {
if uid <= 0 {