MenusAd.php 976 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace App\Models;
  3. class MenusAd extends MenuBaseModel
  4. {
  5. protected $table = 'menus_ad';
  6. public $timestamps = false;
  7. public function getSecondMenusFromSort1($sort1)
  8. {
  9. return $this->where('sort1', $sort1)
  10. ->where('sort3', 0)
  11. ->where('sort2', '<>', 0)
  12. ->orderBy('sort2')
  13. ->get();
  14. }
  15. public function getThirdMenusFromSort1($sort1, $sort2)
  16. {
  17. return $this->where('sort1', $sort1)
  18. ->where('sort2', $sort2)
  19. ->where('sort3', '<>', 0)
  20. ->whereNotNull('href')
  21. ->orderBy('sort3')
  22. ->get();
  23. }
  24. public function getFirstMenus()
  25. {
  26. return $this->where('sort2', 0)
  27. ->where('sort3', 0)
  28. ->where('sort1', '<>', 0)
  29. ->whereNotNull('href')
  30. ->orderBy('sort1')
  31. ->get();
  32. }
  33. }