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

108 lines
2.8 KiB

  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Repositories\ImsCjdcMarket;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Controllers\AdminController;
  8. class ImsCjdcMarketController extends AdminController
  9. {
  10. /**
  11. * Make a grid builder.
  12. *
  13. * @return Grid
  14. */
  15. protected function grid()
  16. {
  17. return Grid::make(new ImsCjdcMarket(), function (Grid $grid) {
  18. $grid->id->sortable();
  19. $grid->logo->image('',50,50);
  20. $grid->name;
  21. $grid->column('status','状态')->display(function ($status){
  22. if ($status==0){
  23. return '禁用';
  24. }else{
  25. return '正常';
  26. }
  27. });
  28. $grid->address;
  29. $grid->column('addtime','创建时间');
  30. $grid->filter(function (Grid\Filter $filter) {
  31. $filter->equal('id');
  32. });
  33. });
  34. }
  35. /**
  36. * Make a show builder.
  37. *
  38. * @param mixed $id
  39. *
  40. * @return Show
  41. */
  42. protected function detail($id)
  43. {
  44. return Show::make($id, new ImsCjdcMarket(), function (Show $show) {
  45. $show->id;
  46. $show->name;
  47. $show->logo;
  48. $show->introduce;
  49. $show->imgs;
  50. $show->addtime;
  51. $show->sort;
  52. $show->status;
  53. $show->coordinates;
  54. $show->remark;
  55. $show->address;
  56. $show->poundage;
  57. $show->dn_poundage;
  58. $show->dm_poundage;
  59. $show->yd_poundage;
  60. $show->dada_number;
  61. $show->is_open_dada;
  62. $show->loudspeaker_imei;
  63. $show->dishes_menu_intro;
  64. $show->create_time;
  65. $show->created_at;
  66. $show->updated_at;
  67. });
  68. }
  69. /**
  70. * Make a form builder.
  71. *
  72. * @return Form
  73. */
  74. protected function form()
  75. {
  76. return Form::make(new ImsCjdcMarket(), function (Form $form) {
  77. $form->display('id');
  78. $form->text('name');
  79. $form->text('logo');
  80. $form->text('introduce');
  81. $form->text('imgs');
  82. $form->text('addtime');
  83. $form->text('sort');
  84. $form->text('status');
  85. $form->text('coordinates');
  86. $form->text('remark');
  87. $form->text('address');
  88. $form->text('poundage');
  89. $form->text('dn_poundage');
  90. $form->text('dm_poundage');
  91. $form->text('yd_poundage');
  92. $form->text('dada_number');
  93. $form->text('is_open_dada');
  94. $form->text('loudspeaker_imei');
  95. $form->text('dishes_menu_intro');
  96. $form->text('create_time');
  97. $form->display('created_at');
  98. $form->display('updated_at');
  99. });
  100. }
  101. }