SmmPostLogController.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. namespace App\Distributor\Controllers;
  3. use App\Distributor\Repositories\SmmPostLog;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Http\Controllers\AdminController;
  8. use Dcat\Admin\Layout\Content;
  9. use Dcat\Admin\Admin;
  10. class SmmPostLogController extends AdminController
  11. {
  12. /**
  13. * page index
  14. */
  15. public function index(Content $content)
  16. {
  17. return $content
  18. ->header('列表')
  19. ->description('全部')
  20. ->breadcrumb(['text'=>'列表','url'=>''])
  21. ->body($this->grid());
  22. }
  23. /**
  24. * Make a grid builder.
  25. *
  26. * @return Grid
  27. */
  28. protected function grid()
  29. {
  30. return Grid::make(new SmmPostLog(), function (Grid $grid) {
  31. $grid->column('id')->sortable();
  32. $grid->column('post_id');
  33. $grid->column('account_id');
  34. $grid->column('status');
  35. $grid->column('remark');
  36. $grid->column('dist_id');
  37. $grid->column('request_content');
  38. $grid->column('response_content');
  39. $grid->column('media_name');
  40. $grid->column('response_ids');
  41. $grid->column('created_at');
  42. $grid->column('updated_at')->sortable();
  43. $grid->filter(function (Grid\Filter $filter) {
  44. $filter->equal('id');
  45. });
  46. });
  47. }
  48. /**
  49. * Make a show builder.
  50. *
  51. * @param mixed $id
  52. *
  53. * @return Show
  54. */
  55. protected function detail($id)
  56. {
  57. return Show::make($id, new SmmPostLog(), function (Show $show) {
  58. $show->field('id');
  59. $show->field('post_id');
  60. $show->field('account_id');
  61. $show->field('status');
  62. $show->field('remark');
  63. $show->field('dist_id');
  64. $show->field('request_content');
  65. $show->field('response_content');
  66. $show->field('media_name');
  67. $show->field('response_ids');
  68. $show->field('created_at');
  69. $show->field('updated_at');
  70. });
  71. }
  72. /**
  73. * Make a form builder.
  74. *
  75. * @return Form
  76. */
  77. protected function form()
  78. {
  79. return Form::make(new SmmPostLog(), function (Form $form) {
  80. $form->display('id');
  81. $form->text('post_id');
  82. $form->text('account_id');
  83. $form->text('status');
  84. $form->text('remark');
  85. $form->text('dist_id');
  86. $form->text('request_content');
  87. $form->text('response_content');
  88. $form->text('media_name');
  89. $form->text('response_ids');
  90. $form->display('created_at');
  91. $form->display('updated_at');
  92. });
  93. }
  94. }