simplePaginate(); $grid->quickSearch(['id', 'user.user_name', 'name', 'mobile', 'province', 'city', 'county', 'adds'])->placeholder('搜索地址ID,用户名字,名称,手机号,省份等...')->width(30); $grid->model()->orderBy('id', 'desc'); $grid->column('id')->sortable(); $grid->column('user.user_avatar','头像')->image('',30,30); $grid->column('user.user_name','用户'); $grid->column('name'); $grid->column('mobile'); $grid->column('province'); $grid->column('city'); $grid->column('county'); $grid->column('adds'); // $grid->column('user_id'); $grid->column('is_check')->using([0=>'否',1=>'是'])->label([ 0=>'default', 1=>'green' ]); $grid->column('state')->using([0 => '正常', 1 => '用户删除'])->label([ 0 => 'primary', 1 => 'default', ]); $grid->column('created_at'); // $grid->column('updated_at')->sortable(); $grid->filter(function (Grid\Filter $filter) { $filter->equal('id'); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new WxShopAddress(), function (Show $show) { $show->field('id'); $show->field('name'); $show->field('mobile'); $show->field('province'); $show->field('city'); $show->field('county'); $show->field('adds'); $show->field('user_id'); $show->field('is_check'); $show->field('state'); $show->field('created_at'); $show->field('updated_at'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new WxShopAddress(), function (Form $form) { $form->display('id'); $form->text('name'); $form->text('mobile'); $form->text('province'); $form->text('city'); $form->text('county'); $form->text('adds'); $form->text('user_id'); $form->text('is_check'); $form->text('state'); $form->deleting(function (Form $form){ global $__MINI_GLOBAL_TENANT_ID__; if($__MINI_GLOBAL_TENANT_ID__ > 0){ return $form->response()->error('权限不足,不可以删除其他分站对象'); } }); }); } }