Fix model issues.

This commit is contained in:
2025-10-30 22:19:48 +00:00
parent 262536135d
commit a7a5169c67
5 changed files with 11 additions and 11 deletions

View File

@@ -27,7 +27,7 @@ func GetNotificationCount(db *sql.DB, userID int) int {
var count int
err := db.QueryRow(`
SELECT COUNT(*) FROM users_notification
WHERE userId = ? AND is_read = FALSE`, userID).Scan(&count)
WHERE user_Id = ? AND is_read = FALSE`, userID).Scan(&count)
if err != nil {
log.Println("⚠️ Failed to count notifications:", err)
@@ -41,7 +41,7 @@ func GetRecentNotifications(db *sql.DB, userID int, limit int) []models.Notifica
rows, err := db.Query(`
SELECT id, subject, body, is_read, created_at
FROM users_notification
WHERE userId = ?
WHERE user_Id = ?
ORDER BY created_at DESC
LIMIT ?`, userID, limit)
if err != nil {