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

95 lines
2.7 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
  1. <?php
  2. namespace App\Admin\Controllers;
  3. use App\Admin\Metrics\Examples;
  4. use App\Http\Controllers\Controller;
  5. use Dcat\Admin\Controllers\Dashboard;
  6. use Dcat\Admin\Layout\Column;
  7. use Dcat\Admin\Layout\Content;
  8. use Dcat\Admin\Layout\Row;
  9. use Dcat\Admin\Admin;
  10. class HomeController extends Controller
  11. {
  12. public function index(Content $content)
  13. {
  14. //dd(Admin::user()->roles);
  15. if (Admin::user()->isRole('lanzu_business')) {
  16. return $this->lanzu_biz($content);
  17. }
  18. if (Admin::user()->isRole('lanzu_mp')) {
  19. return $this->lanzu_mp($content);
  20. }
  21. if (Admin::user()->isRole('lanzu_mm')) {
  22. return $this->lanzu_mm($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(6, function (Column $column) {
  74. });
  75. $row->column(6, function (Column $column) {
  76. });
  77. });
  78. }
  79. }