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

80 lines
2.2 KiB

4 years ago
  1. <?php
  2. namespace App\AdminAgent\Controllers;
  3. use App\AdminAgent\Metrics\Examples\FinanceStatistics;
  4. use Dcat\Admin\Admin;
  5. use Dcat\Admin\Layout\Column;
  6. use Dcat\Admin\Layout\Content;
  7. use Dcat\Admin\Layout\Row;
  8. use Dcat\Admin\Http\Controllers\AdminController;
  9. use Dcat\Admin\Widgets\Card;
  10. class FinanceStatisticsController extends AdminController
  11. {
  12. public function index(Content $content)
  13. {
  14. Admin::style(
  15. <<<CSS
  16. .col-sm-12.d-flex{
  17. display: inline-block !important;
  18. }
  19. CSS
  20. );
  21. $count = $total = $totalNon = 0;
  22. return $content
  23. ->body(
  24. <<<HTML
  25. <div class="content-header">
  26. <section class="content-header breadcrumbs-top">
  27. <h1 class=" float-left">
  28. <span class="text-capitalize">财务统计</span>
  29. </h1>
  30. <div class="clearfix"></div>
  31. </section>
  32. </div>
  33. HTML
  34. )
  35. ->body(function (Row $row) use ($count, $total, $totalNon) {
  36. $row->column(4, function (Column $column) use ($count) {
  37. $column->row(Card::make('金额', function () use ($count) {
  38. return <<<HTML
  39. <div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  40. <h2 class="ml-1 font-large-1 text-primary">$count</h2>
  41. </div>
  42. HTML;
  43. }));
  44. });
  45. $row->column(4, function (Column $column) use ($total) {
  46. $column->row(Card::make('利润', function () use ($total) {
  47. return <<<HTML
  48. <div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  49. <h2 class="ml-1 font-large-1 text-primary">$total</h2>
  50. </div>
  51. HTML;
  52. }));
  53. });
  54. $row->column(4, function (Column $column) use ($totalNon) {
  55. $column->row(Card::make('已完成订单', function () use ($totalNon) {
  56. return <<<HTML
  57. <div class="d-flex justify-content-between align-items-center mt-1" style="margin-bottom: 2px">
  58. <h2 class="ml-1 font-large-1 text-primary">$totalNon</h2>
  59. </div>
  60. HTML;
  61. }));
  62. });
  63. })
  64. ->body(function (Row $row){
  65. $row->column(12,new FinanceStatistics());
  66. });
  67. }
  68. }