diff --git a/plugins/rainlab/blog/controllers/posts/config_filter.yaml b/plugins/rainlab/blog/controllers/posts/config_filter.yaml index fbded84a9..1b197ea90 100644 --- a/plugins/rainlab/blog/controllers/posts/config_filter.yaml +++ b/plugins/rainlab/blog/controllers/posts/config_filter.yaml @@ -14,8 +14,8 @@ scopes: label: Post Title type: text modelClass: RainLab\Blog\Models\Post - scope: FilterId - + scope: FilterName + category: # Filter name diff --git a/plugins/rainlab/blog/models/Post.php b/plugins/rainlab/blog/models/Post.php index 06df23469..7a69c2e09 100644 --- a/plugins/rainlab/blog/models/Post.php +++ b/plugins/rainlab/blog/models/Post.php @@ -536,14 +536,17 @@ class Post extends Model { return $query->where('id', $id); } - - public function scopeFilterName($query, $q) + + public function scopeFilterName($query, $name) { - - return $query = where('title','LIKE','%'.$q.'%') - ->orWhere('slug','LIKE','%'.$q.'%'); + return $query->where('title','LIKE','%'.$name.'%')->orWhere('slug','LIKE','%'.$name.'%'); } + // public function scopeFilterName($query, $name) + // { + // return $query = where('title','LIKE','%'.$name.'%'); + // } + public function scopeFilterLocale($query, array $types) { foreach ($types as $type) { switch ($type) {