优化结构

This commit is contained in:
Yvan
2026-08-28 00:29:40 +08:00
parent 04ff85116c
commit 03a4131f6e
118 changed files with 758 additions and 834 deletions
+9
View File
@@ -40,9 +40,18 @@ func (r *auditQueryRepo) ListLogins(ctx context.Context, page, size int, q *syst
if q.Username != "" {
db = db.Where("username LIKE ?", "%"+q.Username+"%")
}
if q.IP != "" {
db = db.Where("ip LIKE ?", "%"+q.IP+"%")
}
if q.Status != nil {
db = db.Where("status = ?", *q.Status)
}
if q.StartCreatedAt != nil {
db = db.Where("created_at >= ?", *q.StartCreatedAt)
}
if q.EndCreatedAt != nil {
db = db.Where("created_at <= ?", *q.EndCreatedAt)
}
}
var total int64
if err := db.Count(&total).Error; err != nil {