This commit is contained in:
merdan 2021-05-15 13:53:38 +05:00
parent 1b4651cef3
commit 25851047b6
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ use Cms\Classes\Page;
use Bedard\BlogTags\Models\Tag; use Bedard\BlogTags\Models\Tag;
use Cms\Classes\ComponentBase; use Cms\Classes\ComponentBase;
use Rainlab\Blog\Models\Post; use Rainlab\Blog\Models\Post;
use App;
class BlogTagSearch extends ComponentBase class BlogTagSearch extends ComponentBase
{ {
@ -197,7 +198,7 @@ class BlogTagSearch extends ComponentBase
private function calculatePagination() private function calculatePagination()
{ {
// Count the number of posts with this tag // Count the number of posts with this tag
$this->totalPosts = Post::whereHas('tags', function($tag) { $this->totalPosts = Post::whereHas('tags_'.App::getLocale(), function($tag) {
$tag->where('name', $this->property('tag')); $tag->where('name', $this->property('tag'));
}) })
->count(); ->count();