修改文章
This commit is contained in:
@@ -28,7 +28,7 @@ class IndexController extends AdminController
|
||||
});
|
||||
$filter->column(1 / 2, function ($filter) {
|
||||
$filter->equal('position', '首页推荐位')
|
||||
->select(Article::POSITIONS);
|
||||
->select(Article::POSITIONS);
|
||||
});
|
||||
|
||||
$filter->disableIdFilter();
|
||||
@@ -59,27 +59,29 @@ class IndexController extends AdminController
|
||||
$form->belongsToMany('categories', CategorySelectAble::class, __('关联分类'));
|
||||
|
||||
// $form->text('keywords', '关键词')->rules('nullable');
|
||||
$form->text('job', '岗位');
|
||||
$form->text('working', '工龄');
|
||||
$form->textarea('description', '内容简介')->rules('max:350');
|
||||
$form->image('cover', '封面')
|
||||
->move('images/' . date('Y/m/d'))
|
||||
->removable()
|
||||
->uniqueName();
|
||||
->move('images/'.date('Y/m/d'))
|
||||
->removable()
|
||||
->uniqueName();
|
||||
|
||||
$form->ueditor('content', '文章内容');
|
||||
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
|
||||
$form->switch('status', '状态')->default(1);
|
||||
$form->text('url', '外链地址');
|
||||
$form->select('position', '首页推荐位')
|
||||
->options(Article::POSITIONS);
|
||||
->options(Article::POSITIONS);
|
||||
$form->datetime('created_at', '发布时间');
|
||||
$form->saved(function ($form) {
|
||||
if ($form->position) {
|
||||
$model = $form->model();
|
||||
Article::where('position', $form->position)
|
||||
->where('id', '<>', $model->id)
|
||||
->update([
|
||||
'position' => '',
|
||||
]);
|
||||
->where('id', '<>', $model->id)
|
||||
->update([
|
||||
'position' => '',
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user