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();
|
$previousFeaturedPost = $this->getFeaturedPost();
|
||||||
|
|
||||||
$post->setLastFeatureTime($this->timeService->getCurrentTime());
|
if ($previousFeaturedPost->getId() !== $post->getId())
|
||||||
$post->setFeatureCount($post->getFeatureCount() + 1);
|
{
|
||||||
$this->postDao->save($post);
|
$post->setLastFeatureTime($this->timeService->getCurrentTime());
|
||||||
|
$post->setFeatureCount($post->getFeatureCount() + 1);
|
||||||
|
$this->postDao->save($post);
|
||||||
|
}
|
||||||
|
|
||||||
$globalParam = new GlobalParam();
|
$globalParam = new GlobalParam();
|
||||||
$globalParam->setKey(GlobalParam::KEY_FEATURED_POST);
|
$globalParam->setKey(GlobalParam::KEY_FEATURED_POST);
|
||||||
|
|
Loading…
Reference in a new issue