调整但行

This commit is contained in:
2021-02-04 10:50:46 +08:00
parent 735ce6a4ca
commit 0e70658aeb
8 changed files with 62 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ class IndexController extends AdminController
}, '所有分类'));
});
$filter->column(1 / 2, function ($filter) {
$filter->equal('position', '位')
$filter->equal('position', '首页推荐位')
->select(Article::POSITIONS);
});
@@ -76,7 +76,7 @@ class IndexController extends AdminController
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
$form->switch('status', '状态')->default(1);
$form->text('url', '外链地址');
$form->select('position', '位')
$form->select('position', '首页推荐位')
->options(Article::POSITIONS);
$form->datetime('created_at', '发布时间');
$form->saved(function ($form) {

View File

@@ -55,7 +55,7 @@ class IndexController extends AdminController
->removable()
->uniqueName();
$form->number('order', '排序')->default(0);
$form->switch('top_show', '顶部导航显示')->states()->default(0);
// $form->switch('top_show', '顶部导航显示')->states()->default(0);
$form->switch('status', '显示')->states()->default(1);
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
@@ -122,7 +122,7 @@ class IndexController extends AdminController
$form->number('order', '排序')->default(0)->help('正序优先');
$form->switch('status', '显示')->states()->default(1);
$form->switch('top_show', '顶部导航显示')->states();
// $form->switch('top_show', '顶部导航显示')->states();
$form->text('url', '跳转地址')->help('设置后直接跳转到设置的url');
$form->saving(function (Form $form) {

View File

@@ -182,10 +182,12 @@ function getArtilesByCates($cate_id, $take = 8)
$cate_ids = Category::where('parent_id', $cate_id)
->orWhere('id', $cate_id)
->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW])
->get();
->pluck('id')
->toArray();
return Article::whereIn('category_id', $cate_ids)
->latest()
->take($take)
->get();
}