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

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