链街Dcat后台
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.

113 lines
2.8 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Extensions\CheckRow;
  4. use App\Admin\Repositories\LanzuMpInfo;
  5. use Dcat\Admin\Admin;
  6. use Dcat\Admin\Form;
  7. use Dcat\Admin\Grid;
  8. use Dcat\Admin\Show;
  9. use Dcat\Admin\Controllers\AdminController;
  10. class LanzuMpInfoController extends AdminController
  11. {
  12. /**
  13. * Make a grid builder.
  14. *
  15. * @return Grid
  16. */
  17. protected function grid()
  18. {
  19. return Grid::make(new LanzuMpInfo(), function (Grid $grid) {
  20. //$grid->id->sortable();
  21. $grid->name;
  22. $grid->phone;
  23. $grid->bank_name;
  24. $grid->bank_card;
  25. $grid->bank_addr;
  26. $grid->id_frond->image('',50,50);
  27. $grid->id_back->image('',50,50);
  28. $grid->id_number;
  29. //$grid->admin_user_id;
  30. $grid->column('status','状态')->display(function ($status){
  31. if ($status==1){
  32. return '正常';
  33. }elseif($status==0){
  34. return '待审核';
  35. }
  36. });
  37. $grid->created_at->display(function ($time) {
  38. return date("Y-m-d H:i:s",$time);
  39. });
  40. $grid->filter(function (Grid\Filter $filter) {
  41. $filter->equal('id');
  42. });
  43. $grid->filter(function (Grid\Filter $filter) {
  44. $filter->like('name');
  45. });
  46. });
  47. }
  48. public function test()
  49. {
  50. echo 11;
  51. }
  52. /**
  53. * Make a show builder.
  54. *
  55. * @param mixed $id
  56. *
  57. * @return Show
  58. */
  59. protected function detail($id)
  60. {
  61. return Show::make($id, new LanzuMpInfo(), function (Show $show) {
  62. $show->id;
  63. $show->name;
  64. $show->phone;
  65. $show->bank_name;
  66. $show->bank_card;
  67. $show->bank_addr;
  68. $show->id_frond;
  69. $show->id_back;
  70. $show->id_number;
  71. $show->admin_user_id;
  72. $show->status;
  73. $show->created_at;
  74. $show->updated_at;
  75. });
  76. }
  77. /**
  78. * Make a form builder.
  79. *
  80. * @return Form
  81. */
  82. protected function form()
  83. {
  84. return Form::make(new LanzuMpInfo(), function (Form $form) {
  85. $form->display('id')->hideInDialog();
  86. $form->text('name');
  87. $form->text('phone');
  88. $form->text('bank_name');
  89. $form->text('bank_card');
  90. $form->text('bank_addr');
  91. $form->image('id_frond')->uniqueName();
  92. $form->image('id_back')->uniqueName();
  93. $form->text('id_number');
  94. //$form->text('admin_user_id');
  95. $form->number('status','状态');
  96. //$form->display('created_at');
  97. //$form->display('updated_at');
  98. });
  99. }
  100. }