海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.0 KiB

  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Repositories\User;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Http\Controllers\AdminController;
  8. class UserController extends AdminController
  9. {
  10. /**
  11. * Make a grid builder.
  12. *
  13. * @return Grid
  14. */
  15. protected function grid()
  16. {
  17. return Grid::make(new User('agent:id,name'), function (Grid $grid) {
  18. $grid->disableRowSelector();
  19. $grid->disableCreateButton();
  20. $grid->disableActions();
  21. $grid->column('id')->sortable();
  22. $grid->column('agent.name', '代理商账号');
  23. $grid->column('avatar')->image(60, 60);
  24. $grid->column('mobile');
  25. $grid->column('nickname');
  26. $grid->column('status')->bool();
  27. $grid->column('verifier')->bool();
  28. $grid->column('created_at');
  29. $grid->column('updated_at');
  30. $grid->filter(function (Grid\Filter $filter) {
  31. $filter->panel();
  32. $filter->equal('id')->width(1);
  33. $filter->equal('mobile')->width(2);
  34. });
  35. });
  36. }
  37. /**
  38. * Make a show builder.
  39. *
  40. * @param mixed $id
  41. *
  42. * @return Show
  43. */
  44. protected function detail($id)
  45. {
  46. return Show::make($id, new User(), function (Show $show) {
  47. /*$show->field('id');
  48. $show->field('agent_id');
  49. $show->field('avatar');
  50. $show->field('mobile');
  51. $show->field('nickname');
  52. $show->field('openid');
  53. $show->field('status');
  54. $show->field('unionid');
  55. $show->field('verifier');
  56. $show->field('created_at');
  57. $show->field('updated_at');*/
  58. });
  59. }
  60. /**
  61. * Make a form builder.
  62. *
  63. * @return Form
  64. */
  65. protected function form()
  66. {
  67. return Form::make(new User(), function (Form $form) {
  68. /*$form->display('id');
  69. $form->text('status');
  70. $form->text('verifier');*/
  71. });
  72. }
  73. }