Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

semour / semour_admin

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
Normal viewHistoryPermalink
Switch branch/tag
  • semour_admin
  • app
  • Admin
  • Controllers
  • UserController.php
UserController.php 2.59 KB
宁成龙's avatar
用户列表curd
e7545fde
 
宁成龙 committed 2 years ago
1 2 3 4 5
<?php

namespace App\Admin\Controllers;

use App\Admin\Repositories\User;
宁成龙's avatar
完善用户列表
26a96a24
 
宁成龙 committed 2 years ago
6
use App\Admin\Service\UserService;
宁成龙's avatar
用户列表curd
e7545fde
 
宁成龙 committed 2 years ago
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
use Dcat\Admin\Form;
use Dcat\Admin\Grid;
use Dcat\Admin\Show;
use Dcat\Admin\Http\Controllers\AdminController;

class UserController extends AdminController
{
    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        return Grid::make(new User(), function (Grid $grid) {
宁成龙's avatar
完善用户列表
26a96a24
 
宁成龙 committed 2 years ago
22 23 24 25 26 27 28
            $grid->showFilter();
            $grid->disableActions();
            $grid->disableFilterButton();
            $grid->disableRefreshButton();
            $grid->disableCreateButton();
            UserService::userListFilter($grid);
            UserService::userListListField($grid);
宁成龙's avatar
用户列表curd
e7545fde
 
宁成龙 committed 2 years ago
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
        });
    }

    /**
     * Make a show builder.
     *
     * @param mixed $id
     *
     * @return Show
     */
    protected function detail($id)
    {
        return Show::make($id, new User(), function (Show $show) {
            $show->field('id');
            $show->field('user_sn');
            $show->field('name');
            $show->field('email');
            $show->field('email_verified_at');
            $show->field('password');
            $show->field('phone');
            $show->field('remember_token');
            $show->field('account_properties');
            $show->field('status');
            $show->field('company_name');
            $show->field('first_name');
            $show->field('sale_id');
            $show->field('sale_name');
            $show->field('last_name');
            $show->field('created_time');
            $show->field('update_time');
            $show->field('created_at');
            $show->field('updated_at');
        });
    }

    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        return Form::make(new User(), function (Form $form) {
            $form->display('id');
            $form->text('user_sn');
            $form->text('name');
            $form->text('email');
            $form->text('email_verified_at');
            $form->text('password');
            $form->text('phone');
            $form->text('remember_token');
            $form->text('account_properties');
            $form->text('status');
            $form->text('company_name');
            $form->text('first_name');
            $form->text('sale_id');
            $form->text('sale_name');
            $form->text('last_name');
            $form->text('created_time');
            $form->text('update_time');
宁成龙's avatar
完善用户列表
26a96a24
 
宁成龙 committed 2 years ago
89

宁成龙's avatar
用户列表curd
e7545fde
 
宁成龙 committed 2 years ago
90 91 92 93 94
            $form->display('created_at');
            $form->display('updated_at');
        });
    }
}