|
|
|
@ -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'); |
|
|
|
|