From da84249c3cfba679fc6074adf94bacf496a86e4d Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Fri, 4 Sep 2020 17:52:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9banner=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/v3/BannerController.php | 47 ++++++++++++------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/app/Admin/Controllers/v3/BannerController.php b/app/Admin/Controllers/v3/BannerController.php index 2ab494c..5f40e5e 100644 --- a/app/Admin/Controllers/v3/BannerController.php +++ b/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();