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

83 lines
2.2 KiB

  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Repositories\LanzuMmWithdraw;
  4. use Dcat\Admin\Form;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Show;
  7. use Dcat\Admin\Controllers\AdminController;
  8. use Encore\Admin\Facades\Admin;
  9. use Illuminate\Support\Facades\Auth;
  10. class LanzuMmWithdrawController extends AdminController
  11. {
  12. /**
  13. * Make a grid builder.
  14. *
  15. * @return Grid
  16. */
  17. protected function grid()
  18. {
  19. return Grid::make(new LanzuMmWithdraw(), function (Grid $grid) {
  20. $grid->id->sortable();
  21. $grid->column('mm_id','提现人')->display(function (){
  22. return Auth::guard('admin')->user()->toArray()['name'];
  23. });
  24. $grid->money;
  25. $grid->status('提现状态')->display(function ($status){
  26. if ($status==0){
  27. return '待审核';
  28. }elseif ($status==1){
  29. return '已同意';
  30. }else{
  31. return '已拒绝';
  32. }
  33. });
  34. $grid->created_at('提现时间')->display(function ($time){
  35. return date('Y-m-d H:i',$time);
  36. });
  37. $grid->filter(function (Grid\Filter $filter) {
  38. $filter->equal('id');
  39. });
  40. });
  41. }
  42. /**
  43. * Make a show builder.
  44. *
  45. * @param mixed $id
  46. *
  47. * @return Show
  48. */
  49. protected function detail($id)
  50. {
  51. return Show::make($id, new LanzuMmWithdraw(), function (Show $show) {
  52. $show->id;
  53. $show->mm_id;
  54. $show->money;
  55. $show->status;
  56. $show->created_at;
  57. $show->updated_at;
  58. });
  59. }
  60. /**
  61. * Make a form builder.
  62. *
  63. * @return Form
  64. */
  65. protected function form()
  66. {
  67. return Form::make(new LanzuMmWithdraw(), function (Form $form) {
  68. $form->display('name','提现用户')->value(Auth::guard('admin')->user()->toArray()['name']);
  69. $form->display('id');
  70. $form->hidden('mm_id')->value(Auth::guard('admin')->user()->getAuthIdentifier());
  71. $form->text('money');
  72. $form->display('created_at');
  73. $form->display('updated_at');
  74. });
  75. }
  76. }