Add a button for recalculating score

[MAILPOET-3525]
This commit is contained in:
Pavel Dohnal
2021-04-21 14:16:13 +02:00
committed by Veljko V
parent 74f9505772
commit 9eeeb10415
8 changed files with 102 additions and 0 deletions

View File

@ -47,4 +47,11 @@ class StatisticsOpensRepository extends Repository {
$subscriber->setEngagementScore($score);
$this->entityManager->flush();
}
public function resetSubscribersScoreCalculation() {
$this->entityManager->createQueryBuilder()->update(SubscriberEntity::class, 's')
->set('s.engagementScoreUpdatedAt', ':verified')
->setParameter('verified', null)
->getQuery()->execute();
}
}