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

76 lines
2.1 KiB

4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\AdminSupplier\Controllers;
  3. use App\AdminSupplier\Repositories\DepositLog;
  4. use Dcat\Admin\Admin;
  5. use Dcat\Admin\Grid;
  6. use Dcat\Admin\Layout\Column;
  7. use Dcat\Admin\Layout\Content;
  8. use Dcat\Admin\Layout\Row;
  9. use Dcat\Admin\Http\Controllers\AdminController;
  10. use Dcat\Admin\Widgets\Card;
  11. class DepositLogController extends AdminController
  12. {
  13. public function index(Content $content)
  14. {
  15. return $content->title('账户交易金')
  16. ->body(function (Row $row) {
  17. $row->column(3, function (Column $column) {
  18. $column->row(Card::make('正常', function () {
  19. $price = Admin::user()->trade_balance ?? 0;
  20. return <<<HTML
  21. <div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  22. <h2 class="ml-1 font-large-1 text-primary">$price</h2>
  23. </div>
  24. HTML;
  25. }));
  26. });
  27. // $row->column(4, function (Column $column) {
  28. // $column->row(Card::make('冻结', function () {
  29. // $price = Admin::user()->deposit_frozen ?? 0;
  30. // return <<<HTML
  31. //<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  32. // <h2 class="ml-1 font-large-1 text-primary">$price</h2>
  33. //</div>
  34. //HTML;
  35. // }));
  36. //
  37. // });
  38. //
  39. // $row->column(4, function (Column $column) {
  40. // $column->row(Card::make('消费', function () {
  41. // $price = Admin::user()->deposit_used ?? 0;
  42. // return <<<HTML
  43. //<div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  44. // <h2 class="ml-1 font-large-1 text-primary">$price</h2>
  45. //</div>
  46. //HTML;
  47. // }));
  48. //
  49. // });
  50. })
  51. ->body(
  52. Grid::make(new DepositLog(), function (Grid $grid) {
  53. $grid->disableDeleteButton();
  54. $grid->disableRowSelector();
  55. $grid->disableCreateButton();
  56. $grid->disableActions();
  57. $grid->model()->orderBy('id', 'desc')->where('supplier_id', Admin::user()->id);
  58. $grid->column('id')->sortable();
  59. $grid->column('price');
  60. $grid->column('created_at', '时间');
  61. $grid->filter(function (Grid\Filter $filter) {
  62. $filter->equal('id')->width(2);
  63. });
  64. })
  65. );
  66. }
  67. }