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