From 4f267677e30523301cfefff943b2b1f731496d5b Mon Sep 17 00:00:00 2001 From: liangyuyan <1103300295@qq.com> Date: Mon, 28 Sep 2020 11:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=87=92=E6=97=8F=E5=91=98=E5=B7=A5--=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/v3/LanzuEmployeesController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/Admin/Controllers/v3/LanzuEmployeesController.php b/app/Admin/Controllers/v3/LanzuEmployeesController.php index 57db797..0612e5a 100644 --- a/app/Admin/Controllers/v3/LanzuEmployeesController.php +++ b/app/Admin/Controllers/v3/LanzuEmployeesController.php @@ -26,6 +26,8 @@ class LanzuEmployeesController extends AdminController //市场 $marketList = MarketModel::getMarketArray(); $positionList = config('role.position'); + //店铺 + $storeList = StoreModel::getStoreArray([['market_id','=',1]]); $grid->column('id')->sortable(); $grid->column('name'); @@ -34,9 +36,8 @@ class LanzuEmployeesController extends AdminController $grid->column('market_id')->display(function($marketId) use($marketList){ return isset($marketList[$marketId]) ? $marketList[$marketId] : ''; }); - $grid->column('store_id')->display(function($storeId){ - $item = StoreModel::getStoreInfo($storeId,'name'); - return empty($item) ? '' : $item->name; + $grid->column('store_id')->display(function($storeId) use($storeList){ + return isset($storeList[$storeId]) ? $storeList[$storeId] : ''; }); $grid->column('position')->display(function($position) use($positionList){ @@ -50,9 +51,12 @@ class LanzuEmployeesController extends AdminController }); $grid->column('status')->width(3)->select(EmployeesModel::$_STATUS); - $grid->filter(function (Grid\Filter $filter) use($marketList,$positionList){ + $grid->filter(function (Grid\Filter $filter) use($marketList,$positionList,$storeList){ $filter->equal('id'); $filter->equal('market_id')->select($marketList); + $filter->equal('user_id'); + $filter->like('name'); + $filter->equal('store_id')->select($storeList); $filter->like('position')->select($positionList); }); $grid->model()->orderBy('status','desc');