<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Admin\Controller; use Illuminate\Routing\Controller; use ModStart\Admin\Concern\HasAdminQuickCRUD; use ModStart\Admin\Layout\AdminCRUDBuilder; use ModStart\Form\Form; use ModStart\Grid\GridFilter; use ModStart\Support\Concern\HasFields; use Module\Member\Util\MemberGroupUtil; class MemberGroupController extends Controller { use HasAdminQuickCRUD; protected function crud(AdminCRUDBuilder $enw1u) { $enw1u->init('member_group')->field(function ($enw1u) { $enw1u->id('id', 'ID')->editable(true)->addable(true); $enw1u->text('title', '名称'); $enw1u->text('description', '描述'); $enw1u->switch('isDefault', '默认')->optionsYesNo()->help(''); $enw1u->switch('showFront', '前台显示')->optionsYesNo()->help(''); $enw1u->display('created_at', L('Created At'))->listable(false); $enw1u->display('updated_at', L('Updated At'))->listable(false); })->gridFilter(function (GridFilter $zBPGV) { $zBPGV->like('title', '名称'); })->enablePagination(false)->defaultOrder(array('id', 'asc'))->canSort(true)->title('用户分组')->dialogSizeSmall()->hookSaved(function (Form $hUMbi) { MemberGroupUtil::clearCache(); }); $enw1u->repository()->setSortColumn('id'); } }