SettingController.php 943 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Http\Controllers\V1;
  3. use App\Models\Banner;
  4. use App\Models\NavBar;
  5. use App\Models\Tabbar;
  6. class SettingController extends Controller
  7. {
  8. /**
  9. * 底部导航
  10. */
  11. public function tabBar()
  12. {
  13. $all = Tabbar::select(['name','icon','type'])
  14. ->where('status',1)
  15. ->orderByDesc('sort')
  16. ->get();
  17. return $this->success($all);
  18. }
  19. /**
  20. * 首页顶部分类
  21. */
  22. public function navBar()
  23. {
  24. $all = NavBar::select(['name','icon','type'])
  25. ->where('status',1)
  26. ->orderByDesc('sort')
  27. ->get();
  28. return $this->success($all);
  29. }
  30. /**
  31. * 首页顶部分类
  32. */
  33. public function banner()
  34. {
  35. $all = Banner::select(['name as title','image'])
  36. ->where('status',1)
  37. ->orderByDesc('sort')
  38. ->get();
  39. return $this->success($all);
  40. }
  41. }