调整筛选项
This commit is contained in:
@@ -21,16 +21,20 @@ class IndexController extends AdminController
|
||||
$grid->filter(function ($filter) {
|
||||
$filter->column(1 / 2, function ($filter) {
|
||||
$filter->like('title', '视频名称');
|
||||
|
||||
});
|
||||
$filter->column(1 / 2, function ($filter) {
|
||||
$filter->like('category.id', '分类名称')
|
||||
->select(Category::selectOptions(function ($model) {
|
||||
return $model->where('status', 1)->where('type', Category::TYPE_ADVERT);
|
||||
}, '所有分类'));
|
||||
->select(Category::where([
|
||||
'status' => 1,
|
||||
'type' => Category::TYPE_VIDEO,
|
||||
])->pluck('title', 'id'));
|
||||
});
|
||||
$filter->disableIdFilter();
|
||||
});
|
||||
|
||||
$grid->column('id');
|
||||
$grid->column('title', '视频名称');
|
||||
$grid->column('title', '视频名称')->width('500');
|
||||
$grid->column('cover', '封面')->image();
|
||||
$grid->column('link', '视频地址')->downloadable();
|
||||
$grid->column('category.title', '分类名称');
|
||||
|
||||
Reference in New Issue
Block a user