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]);
|
$usersForUpdate = $this->userRepo->findBy(['removed' => false]);
|
||||||
} else {
|
} else {
|
||||||
/** @var User $serviceUser */
|
/** @var User $serviceUser */
|
||||||
|
try {
|
||||||
$serviceUser = $this->userRepo->findActiveUserWithSubscribers($appUserId);
|
$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) {
|
if (!$serviceUser) {
|
||||||
$this->logger->critical('Service user not found or marked as removed');
|
$this->logger->critical('Service user not found or marked as removed');
|
||||||
|
|
|
@ -22,9 +22,9 @@ class UserRepository extends EntityRepository
|
||||||
->select(['u', 's', 'us'])
|
->select(['u', 's', 'us'])
|
||||||
->innerJoin('u.subscribers', 's')
|
->innerJoin('u.subscribers', 's')
|
||||||
->innerJoin('s.subscriber', 'us')
|
->innerJoin('s.subscriber', 'us')
|
||||||
->where('u.id = :id')
|
->where('u.id = :user_id')
|
||||||
->where('u.removed = FALSE')
|
->andWhere('u.removed = FALSE')
|
||||||
->setParameter('id', $id)
|
->setParameter('user_id', $id)
|
||||||
->getQuery()->getOneOrNullResult()
|
->getQuery()->getOneOrNullResult()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue