人人商城

frame.mod.php 1.2KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. function frame_lists(){
  8. $data = pdo_fetchall('SELECT * FROM ' . tablename('core_menu') . ' WHERE pid = 0 ORDER BY is_system ASC, displayorder ASC, id ASC');
  9. if(!empty($data)) {
  10. foreach($data as &$da) {
  11. $childs = pdo_fetchall('SELECT * FROM ' . tablename('core_menu') . ' WHERE pid = :pid ORDER BY is_system ASC, displayorder ASC, id ASC', array(':pid' => $da['id']));
  12. if(!empty($childs)) {
  13. foreach($childs as &$child) {
  14. $grandchilds = pdo_fetchall('SELECT * FROM ' . tablename('core_menu') . ' WHERE pid = :pid ORDER BY is_system ASC, displayorder ASC, id ASC', array(':pid' => $child['id']));
  15. if(!empty($grandchilds)) {
  16. foreach($grandchilds as &$grandchild) {
  17. $greatsons = pdo_fetchall('SELECT * FROM ' . tablename('core_menu') . ' WHERE pid = :pid ORDER BY is_system ASC, displayorder ASC, id ASC', array(':pid' => $grandchild['id']));
  18. $grandchild['greatsons'] = $greatsons;
  19. }
  20. }
  21. $child['grandchild'] = $grandchilds;
  22. }
  23. $da['child'] = $childs;
  24. }
  25. }
  26. }
  27. return $data;
  28. }