BottomMenuOriginal.php 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class BottomMenuOriginal extends Model
  5. {
  6. protected $connection = 'mysql';
  7. protected $pk = 'id';
  8. protected $name = 'bottom_menu_original';
  9. public static function getpagearray($mo = '')
  10. {
  11. $where['weid'] = 0;
  12. if (config('database.app_name') == config('my.app_v2')) {
  13. $where['is_v2'] = 1;
  14. }
  15. if (config('database.app_name') == config('my.app_v3')) {
  16. $where['is_v3'] = 1;
  17. }
  18. if (config('database.app_name') == config('my.app_v6')) {
  19. $where['is_v6'] = 1;
  20. }
  21. if (!empty($mo)) {
  22. $where['module'] = $mo;
  23. }
  24. $data = self::field('url,title')->where($where)
  25. ->order('sort asc')
  26. ->select()->toArray();
  27. foreach ($data as $k => $v) {
  28. $array[$k]['val'] = $v['url'];
  29. $array[$k]['key'] = $v['title'];
  30. }
  31. return $array;
  32. }
  33. }