示例#1
0
 public static function getList()
 {
     $dbGoodsKeys = new DBNavKeyType();
     $dbGoodsKeys->getList();
     $ret = [];
     $resKeys = [DB::TABLE_NAV_KEY__ID, DB::TABLE_NAV_KEY__VALUE, DB::TABLE_NAV_KEY__KEY_ITEM, DB::TABLE_NAV_KEY__PARENT_KEY, DB::TABLE_NAV_KEY__HOME_VIEW];
     $response = $dbGoodsKeys->getResponse();
     while ($row = mysql_fetch_array($response)) {
         $item = [];
         foreach ($resKeys as $key) {
             $item[$key] = $row[$key];
         }
         array_push($ret, $item);
     }
     return $ret;
 }
示例#2
0
 public function buildTreeByLeafs()
 {
     $navKeys = new DBNavKeyType();
     $leafsMysql = $navKeys->getLeafs();
     $leafs = array();
     while ($row = mysql_fetch_array($leafsMysql)) {
         array_push($leafs, $row[DB::TABLE_NAV_KEY__KEY_ITEM]);
     }
     $navKeys->executeRequest('', '', DB::TABLE_NAV_KEY__ID, DB::ASC);
     //build full tree
     $mainTree = $this->buildTree($navKeys->getResponse(), "GN");
     $this->clearTree($mainTree, $leafs);
     return $mainTree;
 }