Incorrect query build fix.
This commit is contained in:
parent
76b332155b
commit
c83833c45d
|
@ -234,7 +234,13 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand
|
|||
$usersForUpdate = $this->userRepo->findBy(['removed' => false]);
|
||||
} else {
|
||||
/** @var User $serviceUser */
|
||||
try {
|
||||
$serviceUser = $this->userRepo->findActiveUserWithSubscribers($appUserId);
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error('Error while getting active user with subscribers', ['app_user_id' => $appUserId]);
|
||||
|
||||
throw $e;
|
||||
}
|
||||
|
||||
if (!$serviceUser) {
|
||||
$this->logger->critical('Service user not found or marked as removed');
|
||||
|
|
|
@ -22,9 +22,9 @@ class UserRepository extends EntityRepository
|
|||
->select(['u', 's', 'us'])
|
||||
->innerJoin('u.subscribers', 's')
|
||||
->innerJoin('s.subscriber', 'us')
|
||||
->where('u.id = :id')
|
||||
->where('u.removed = FALSE')
|
||||
->setParameter('id', $id)
|
||||
->where('u.id = :user_id')
|
||||
->andWhere('u.removed = FALSE')
|
||||
->setParameter('user_id', $id)
|
||||
->getQuery()->getOneOrNullResult()
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue