Fixed featuring the same post bumping counter
This commit is contained in:
parent
3dbb2b06be
commit
ef98e00b15
1 changed files with 6 additions and 3 deletions
|
@ -69,9 +69,12 @@ class PostFeatureService
|
|||
{
|
||||
$previousFeaturedPost = $this->getFeaturedPost();
|
||||
|
||||
$post->setLastFeatureTime($this->timeService->getCurrentTime());
|
||||
$post->setFeatureCount($post->getFeatureCount() + 1);
|
||||
$this->postDao->save($post);
|
||||
if ($previousFeaturedPost->getId() !== $post->getId())
|
||||
{
|
||||
$post->setLastFeatureTime($this->timeService->getCurrentTime());
|
||||
$post->setFeatureCount($post->getFeatureCount() + 1);
|
||||
$this->postDao->save($post);
|
||||
}
|
||||
|
||||
$globalParam = new GlobalParam();
|
||||
$globalParam->setKey(GlobalParam::KEY_FEATURED_POST);
|
||||
|
|
Loading…
Reference in a new issue