mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-07-16 21:26:13 +08:00
36 lines
977 B
PHP
36 lines
977 B
PHP
<?php
|
|
|
|
namespace App\Services\Frontend\Chapter;
|
|
|
|
use App\Models\Chapter as ChapterModel;
|
|
use App\Models\User as UserModel;
|
|
|
|
trait VoteTrait
|
|
{
|
|
|
|
protected function incrAgreeCount(ChapterModel $chapter)
|
|
{
|
|
$this->getEventsManager->fire('chapterCounter:incrAgreeCount', $this, $chapter);
|
|
}
|
|
|
|
protected function decrAgreeCount(ChapterModel $chapter)
|
|
{
|
|
$this->getEventsManager->fire('chapterCounter:decrAgreeCount', $this, $chapter);
|
|
}
|
|
|
|
protected function incrOpposeCount(ChapterModel $chapter)
|
|
{
|
|
$this->getEventsManager->fire('chapterCounter:incrOpposeCount', $this, $chapter);
|
|
}
|
|
|
|
protected function decrOpposeCount(ChapterModel $chapter)
|
|
{
|
|
$this->getEventsManager->fire('chapterCounter:decrOpposeCount', $this, $chapter);
|
|
}
|
|
|
|
protected function incrUserDailyChapterVoteCount(UserModel $user)
|
|
{
|
|
$this->getEventsManager->fire('userDailyCounter:incrChapterVoteCount', $this, $user);
|
|
}
|
|
|
|
} |