海南旅游SAAS
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.

79 lines
2.1 KiB

4 years ago
  1. <?php
  2. namespace App\AdminSupplier\Controllers;
  3. use App\AdminAgent\Controllers\AdvertisingController;
  4. use App\AdminSupplier\Repositories\DepositLog;
  5. use App\Traits\StatementTraits;
  6. use Dcat\Admin\Admin;
  7. use Dcat\Admin\Form;
  8. use Dcat\Admin\Grid;
  9. use Dcat\Admin\Show;
  10. use Dcat\Admin\Http\Controllers\AdminController;
  11. class DepositLogController extends AdminController
  12. {
  13. /**
  14. * Make a grid builder.
  15. *
  16. * @return Grid
  17. */
  18. protected function grid()
  19. {
  20. return Grid::make(new DepositLog('supplier'), function (Grid $grid) {
  21. $grid->model()->where('supplier_id',Admin::user()->id);
  22. $grid->column('id')->sortable();
  23. $grid->column('price');
  24. $grid->column('supplier.name','供应商');
  25. $grid->column('type','类型')->using(StatementTraits::$depositText);
  26. $grid->column('created_at');
  27. $grid->column('updated_at')->sortable();
  28. $grid->disableDeleteButton();
  29. $grid->disableRowSelector();
  30. $grid->disableCreateButton();
  31. $grid->disableActions();
  32. $grid->filter(function (Grid\Filter $filter) {
  33. $filter->equal('type','状态')->width(2)->select(StatementTraits::$depositText);
  34. });
  35. });
  36. }
  37. ///**
  38. // * Make a show builder.
  39. // *
  40. // * @param mixed $id
  41. // *
  42. // * @return Show
  43. // */
  44. //protected function detail($id)
  45. //{
  46. // return Show::make($id, new DepositLog(), function (Show $show) {
  47. // $show->field('id');
  48. // $show->field('price');
  49. // $show->field('supplier_id');
  50. // $show->field('type');
  51. // $show->field('created_at');
  52. // $show->field('updated_at');
  53. // });
  54. //}
  55. //
  56. ///**
  57. // * Make a form builder.
  58. // *
  59. // * @return Form
  60. // */
  61. //protected function form()
  62. //{
  63. // return Form::make(new DepositLog(), function (Form $form) {
  64. // $form->display('id');
  65. // $form->text('price');
  66. // $form->text('supplier_id');
  67. // $form->text('type');
  68. //
  69. // $form->display('created_at');
  70. // $form->display('updated_at');
  71. // });
  72. //}
  73. }