Browse Source

修改banner查看详情

master
liangyuyan 6 years ago
parent
commit
da84249c3c
  1. 47
      app/Admin/Controllers/v3/BannerController.php

47
app/Admin/Controllers/v3/BannerController.php

@ -23,7 +23,7 @@ class BannerController extends AdminController
$grid->column('id')->sortable();
$grid->column('market_id')->display(function($markerId){
$market = MarketModel::getMarketInfo($markerId,'name');
return empty($market) ? '' : $market['name'];
return empty($market) ? '' : $market['name'];
});
$grid->column('title');
$grid->column('cover_url')->image(50);
@ -43,7 +43,7 @@ class BannerController extends AdminController
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('id');
});
});
}
@ -58,19 +58,34 @@ class BannerController extends AdminController
protected function detail($id)
{
return Show::make($id, new Banner(), function (Show $show) {
$show->field('id');
$show->field('market_id');
$show->field('title');
$show->field('sub_title');
$show->field('cover');
$show->field('cover_type');
$show->field('path');
$show->field('path_type');
$show->field('sort');
$show->field('status');
$show->field('type');
$show->field('created_at');
$show->field('updated_at');
$show->row(function (Show\Row $show) {
$show->width(6)->field('id');
$show->width(6)->field('market_id');
$show->width(6)->field('cover_type');
$show->width(6)->field('cover')->image();
$show->width(6)->field('type');
$show->width(6)->field('sort');
$show->width(6)->field('created_at');
});
$show->row(function (Show\Row $show) {
$show->width(6)->field('title');
$show->width(6)->field('sub_title');
$show->width(6)->field('path_type');
$show->width(6)->field('path');
$show->width(6)->field('status');
$show->width(6)->field('updated_at');
});
});
}
@ -96,7 +111,7 @@ class BannerController extends AdminController
$form->text('path')->default('');
$form->select('path_type')->options(BannerModel::$_pathType)->default('');
$form->number('sort')->width(2)->default(0);
$form->disableResetButton();
$form->disableViewCheck();

Loading…
Cancel
Save