| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?php
- namespace App\Module\Fund\AdminControllers;
- use App\Module\Fund\Admin\Actions\Circulation;
- use App\Module\Fund\Admin\Actions\FundAdminAction;
- use App\Module\Fund\Repositorys\FundRepository;
- use App\Module\Fund\Services\AccountService;
- use Spatie\RouteAttributes\Attributes\Resource;
- use UCore\DcatAdmin\AdminController;
- use UCore\DcatAdmin\FilterHelper;
- use UCore\DcatAdmin\GridHelper;
- use Dcat\Admin\Form;
- use Dcat\Admin\Grid;
- use Dcat\Admin\Layout\Content;
- use Dcat\Admin\Show;
- use App\Module\Fund\Models\FundModel;
- use App\Module\Fund\Repositorys\FundRepository as Fund;
- /**
- * 资金账户
- */
- #[Resource('fund', names: 'dcat.admin.fund')]
- class FundController extends AdminController
- {
- protected $title='资金账户';
- /**
- * Make a grid builder.
- *
- * @return Grid
- */
- protected function grid()
- {
- return Grid::make(new Fund(['user']), function (Grid $grid) {
- $helper = new GridHelper($grid, $this);
- $helper->columnIdDesc();
- $helper->columnUserIDInfo();
- $grid->column('fund_id', '账户')->using(AccountService::getFundsDesc());
- $helper->columnc1000('balance')->sortable();
- $helper->columnAt('create_time');
- $helper->columnAt('update_time');
- $helper->disableAll();
- $grid->filter(function (Grid\Filter $filter) {
- $helper= new FilterHelper($filter,$this);
- $filter->equal('user_id');
- $helper->equalRadio('fund_id',AccountService::getFundsDesc(),'账户');
- $helper->gtas('user_idgt','user_id','最小');
- $filter->expand();
- $filter->panel();
- });
- $grid->actions(function (Grid\Displayers\Actions $actions) {
- // $actions->disableDelete();
- // $actions->disableView();
- $actions->append(new FundAdminAction());
- $actions->append(new Circulation());
- });
- });
- }
- /**
- * Make a show builder.
- *
- * @param mixed $id
- *
- * @return Show
- */
- protected function detail($id)
- {
- return Show::make($id, new FundRepository(), 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 Fund(), function (Form $form) {
- });
- }
- public function circulation(Content $content)
- {
- return $content
- ->title('流转')
- ->body(new CirculationForm());
- }
- }
|