from server 31.12
This commit is contained in:
parent
17e4aecc58
commit
8a7e53902e
|
|
@ -10,7 +10,12 @@ scopes:
|
|||
modelClass: RainLab\Blog\Models\Post
|
||||
scope: FilterId
|
||||
# conditions: id in (:filtered)
|
||||
|
||||
title:
|
||||
label: Post Title
|
||||
type: text
|
||||
modelClass: RainLab\Blog\Models\Post
|
||||
scope: FilterId
|
||||
|
||||
category:
|
||||
|
||||
# Filter name
|
||||
|
|
|
|||
|
|
@ -536,6 +536,13 @@ class Post extends Model
|
|||
{
|
||||
return $query->where('id', $id);
|
||||
}
|
||||
|
||||
public function scopeFilterName($query, $q)
|
||||
{
|
||||
|
||||
return $query = where('title','LIKE','%'.$q.'%')
|
||||
->orWhere('slug','LIKE','%'.$q.'%');
|
||||
}
|
||||
|
||||
public function scopeFilterLocale($query, array $types) {
|
||||
foreach ($types as $type) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue