fix: split workbench core mysql access

This commit is contained in:
richjohnrambo
2026-10-07 14:38:56 +08:00
parent 8d32376de8
commit c13fb72849
8 changed files with 237 additions and 5 deletions
+4 -1
View File
@@ -172,10 +172,13 @@ func (s *Store) WorkbenchModules(ctx context.Context, userID int64) ([]Workbench
}
func (s *Store) MeetingUnreadCount(ctx context.Context, userID int64) (int, error) {
if s.core == nil || s.core.db == nil {
return 0, nil
}
var count int
query := fmt.Sprintf(`SELECT COUNT(*) FROM %s
WHERE tenant_id=? AND user_id=? AND read_at IS NULL AND event_type LIKE 'meeting.%%'`, tenantSystemNotificationsTable(s.tenant()))
err := s.db.GetContext(ctx, &count, query, s.tenant(), userID)
err := s.core.db.GetContext(ctx, &count, query, s.tenant(), userID)
if isMissingTable(err) {
return 0, nil
}