fix: split workbench core mysql access
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user