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

65 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->new_user_total;
  23. $grid->filter(function (Grid\Filter $filter) {
  24. $filter->equal('id');
  25. });
  26. });
  27. }
  28. /**
  29. * Make a show builder.
  30. *
  31. * @param mixed $id
  32. *
  33. * @return Show
  34. */
  35. protected function detail($id)
  36. {
  37. return Show::make($id, new StoreUserReport(), function (Show $show) {
  38. $show->id;
  39. $show->market_id;
  40. $show->name;
  41. $show->mm_user_id;
  42. });
  43. }
  44. /**
  45. * Make a form builder.
  46. *
  47. * @return Form
  48. */
  49. protected function form()
  50. {
  51. return Form::make(new StoreUserReport(), function (Form $form) {
  52. $form->display('id');
  53. $form->text('market_id');
  54. $form->text('name');
  55. $form->text('mm_user_id');
  56. });
  57. }
  58. }