链街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.

64 lines
1.4 KiB

  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Repositories\StoreUserReport;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Controllers\AdminController;
  8. class StoreUserReportController extends AdminController
  9. {
  10. /**
  11. * Make a grid builder.
  12. *
  13. * @return Grid
  14. */
  15. protected function grid()
  16. {
  17. return Grid::make(new StoreUserReport(), function (Grid $grid) {
  18. $grid->id->sortable();
  19. $grid->market_id;
  20. $grid->name;
  21. $grid->mm_user_id;
  22. $grid->filter(function (Grid\Filter $filter) {
  23. $filter->equal('id');
  24. });
  25. });
  26. }
  27. /**
  28. * Make a show builder.
  29. *
  30. * @param mixed $id
  31. *
  32. * @return Show
  33. */
  34. protected function detail($id)
  35. {
  36. return Show::make($id, new StoreUserReport(), function (Show $show) {
  37. $show->id;
  38. $show->market_id;
  39. $show->name;
  40. $show->mm_user_id;
  41. });
  42. }
  43. /**
  44. * Make a form builder.
  45. *
  46. * @return Form
  47. */
  48. protected function form()
  49. {
  50. return Form::make(new StoreUserReport(), function (Form $form) {
  51. $form->display('id');
  52. $form->text('market_id');
  53. $form->text('name');
  54. $form->text('mm_user_id');
  55. });
  56. }
  57. }