Refactor Promotion.applied scope to query faster

* Before the scope did two joins. Joining the join table and than the
  orders table. As joining the join table is sufficient to define the
  result set removing one layer of joins significantly speeds up the
  operation on large order tables.

Fixes #5453