BottomMenuType.php 728 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\model;
  3. use think\Model;
  4. class BottomMenuType extends Model
  5. {
  6. protected $connection = 'mysql';
  7. protected $pk = 'id';
  8. protected $name = 'bottom_menu_type';
  9. public static function getTitle($id)
  10. {
  11. $data = [];
  12. $data = self::find($id);
  13. if (!empty($data)) {
  14. $data = $data->toArray();
  15. $returndata = $data['title'];
  16. }
  17. return $returndata;
  18. }
  19. public static function getpagearray() {
  20. $data = self::field('id,title')->where(['weid'=>weid(),'status' => 1])
  21. ->order('sort asc')
  22. ->select()->toArray();
  23. foreach ($data as $k => $v) {
  24. $array[$k]['val'] = $v['id'];
  25. $array[$k]['key'] = $v['title'];
  26. }
  27. return $array;
  28. }
  29. }