SettingController.php 1.3 KB

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