Round score to 1 decimal instead of 0

[MAILPOET-3525]
This commit is contained in:
Pavel Dohnal
2021-04-21 10:21:01 +02:00
committed by Veljko V
parent a2c1b4f8bc
commit 3f91c40594
7 changed files with 36 additions and 19 deletions

View File

@ -9,7 +9,7 @@ use MailPoet\Entities\SubscriberEntity;
use MailPoet\Tasks\Sending;
/**
* @extends Repository<StatisticsOpensEntity>
* @extends Repository<StatisticsOpenEntity>
*/
class StatisticsOpensRepository extends Repository {
protected function getEntityClassName(): string {
@ -43,7 +43,7 @@ class StatisticsOpensRepository extends Repository {
->setParameter('subscriberId', $subscriber)
->getQuery()
->getSingleScalarResult();
$score = (int)round(($opens / $newslettersSentCount) * 100);
$score = ($opens / $newslettersSentCount) * 100;
$subscriber->setEngagementScore($score);
$this->entityManager->flush();
}