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

115 lines
3.4 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\admin\Card\Community;
  4. use App\Admin\Metrics\Examples;
  5. use App\Http\Controllers\Controller;
  6. use Dcat\Admin\Controllers\Dashboard;
  7. use Dcat\Admin\Layout\Column;
  8. use Dcat\Admin\Layout\Content;
  9. use Dcat\Admin\Layout\Row;
  10. use Dcat\Admin\Admin;
  11. class HomeController extends Controller
  12. {
  13. public function index(Content $content)
  14. {
  15. if (Admin::user()->isRole('lanzu_business')) {
  16. return $this->lanzu_biz($content);
  17. }elseif (Admin::user()->isRole('lanzu_mp')) {
  18. return $this->lanzu_mp($content);
  19. }elseif (Admin::user()->isRole('lanzu_mm')) {
  20. return $this->lanzu_mm($content);
  21. }elseif (Admin::user()->isRole('lanzu_cs')){
  22. return $this->lanzu_cs($content);
  23. }
  24. return $this->default($content);
  25. }
  26. protected function default(Content $content)
  27. {
  28. return $content
  29. ->header('Dashboard')
  30. ->description('Description...')
  31. ->body(function (Row $row) {
  32. $row->column(6, function (Column $column) {
  33. $column->row(Dashboard::title());
  34. $column->row(new Examples\Tickets());
  35. });
  36. $row->column(6, function (Column $column) {
  37. $column->row(function (Row $row) {
  38. $row->column(6, new Examples\NewUsers());
  39. $row->column(6, new Examples\NewDevices());
  40. });
  41. $column->row(new Examples\Sessions());
  42. $column->row(new Examples\ProductOrders());
  43. });
  44. });
  45. }
  46. protected function lanzu_mp(Content $content)
  47. {
  48. return $content->header('控制面板')
  49. ->description('欢迎回到懒族后台')
  50. ->body(function (Row $row) {
  51. $row->column(6, function (Column $column) {
  52. });
  53. $row->column(6, function (Column $column) {
  54. });
  55. });
  56. }
  57. protected function lanzu_mm(Content $content)
  58. {
  59. return $content->header('控制面板')
  60. ->description('欢迎回到懒族后台')
  61. ->body(function (Row $row) {
  62. $row->column(6, function (Column $column) {
  63. });
  64. $row->column(6, function (Column $column) {
  65. });
  66. });
  67. }
  68. protected function lanzu_biz(Content $content)
  69. {
  70. return $content->header('控制面板')
  71. ->description('欢迎回到懒族后台')
  72. ->body(function (Row $row) {
  73. $row->column(4, function (Column $column) {
  74. $column->row(new Examples\TotalCommunity());
  75. });
  76. $row->column(4, function (Column $column) {
  77. $column->row(new Community\TotalUser());
  78. });
  79. });
  80. }
  81. protected function lanzu_cs(Content $content)
  82. {
  83. return $content->header('控制面板')
  84. ->description('欢迎回到懒族后台')
  85. ->body(function (Row $row) {
  86. $row->column(4, function (Column $column) {
  87. $column->row(new Community\TotalUser());
  88. });
  89. $row->column(4, function (Column $column) {
  90. $column->row(new Community\TotalAmount());
  91. });
  92. });
  93. }
  94. }