model()->with('user'); $helper = new GridHelper($grid,$this); $helper->disableAll(); $helper->columnIdDesc(); $helper->columnUserID(); $helper->columnUsingkv('fund_id', AccountService::getFundsDesc(),'来源账户'); $helper->columnUsingkv('to_fund_id', AccountService::getFundsDesc(),'目标账户'); $helper->columnc1000('total_fee','数额'); $helper->columnAt('create_time'); $grid->column('re_type','关联')->expand(function(){ $url = admin_url('404'); $title = '未知'; $link = new Link($title,$url); return $link; }); // $helper->columnAt('ok_time'); // * @property string $re_type 关联类型 // * @property int $re_id 关联类型 // $helper- // $grid->filter(function (Grid\Filter $filter) { $helper= new FilterHelper($filter,$this); $filter->equal('id', 'ID'); $filter->equal('user_id', '用户ID'); $helper->equalRadio('fund_id', AccountService::getFundsDesc(), '来源账户'); $helper->equalRadio('to_fund_id', AccountService::getFundsDesc(), '目标账户'); $helper->betweenAmount('total_fee', '金额范围'); // 添加金额范围筛选 $helper->betweenTimestamp('create_time', '创建时间'); }); $grid->disableCreateButton(); $grid->actions(function (Grid\Displayers\Actions $actions) { // $actions->disableDelete(); $actions->disableView(); }); }); } /** * Make a show builder. * * @param mixed $id * * @return Show */ protected function detail($id) { return Show::make($id, new FundCirculation(), function (Show $show) { $show->field('id'); $show->field('service_id'); $show->field('title'); $show->field('title_i18n'); }); } /** * Make a form builder. * * @return Form */ protected function form() { return Form::make(new FundCirculation(), function (Form $form) { }); } }