当前位置: 首页>>代码示例>>PHP>>正文


PHP Tree::getArrayList方法代码示例

本文整理汇总了PHP中Tree::getArrayList方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::getArrayList方法的具体用法?PHP Tree::getArrayList怎么用?PHP Tree::getArrayList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree::getArrayList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bm

 function get_header_gcategories($amount, $position, $brand_is_recommend = 1)
 {
     $gcategory_mod =& bm('gcategory', array('_store_id' => 0));
     $gcategories = array();
     if (!$amount) {
         $gcategories = $gcategory_mod->get_list(-1, true);
     } else {
         $gcategory = $gcategory_mod->get_list(0, true);
         $gcategories = $gcategory;
         foreach ($gcategory as $val) {
             $result = $gcategory_mod->get_list($val['cate_id'], true);
             $result = array_slice($result, 0, $amount);
             $gcategories = array_merge($gcategories, $result);
         }
     }
     import('tree.lib');
     $tree = new Tree();
     $tree->setTree($gcategories, 'cate_id', 'parent_id', 'cate_name');
     $gcategory_list = $tree->getArrayList(0);
     $i = 0;
     $brand_mod =& m('brand');
     foreach ($gcategory_list as $k => $v) {
         $gcategory_list[$k]['top'] = isset($position[$i]) ? $position[$i] : '0px';
         $i++;
         $gcategory_list[$k]['brands'] = $brand_mod->find(array('conditions' => "tag = '" . $v['value'] . "' AND recommended=" . $brand_is_recommend, 'order' => 'sort_order asc,brand_id desc'));
     }
     return array('gcategories' => $gcategory_list);
 }
开发者ID:BGCX261,项目名称:zmall-svn-to-git,代码行数:28,代码来源:main.widget.php

示例2: bm

 function _get_data()
 {
     $cache_server =& cache_server();
     $key = $this->_get_cache_id();
     $data = $cache_server->get($key);
     if ($data === false) {
         $gcategory_mod =& bm('gcategory', array('_store_id' => 0));
         $gcategories = array();
         $brand_mod =& m('brand');
         if (empty($this->options['amount'])) {
             $gcategories = $gcategory_mod->get_list(-1, true);
         } else {
             $gcategory = $gcategory_mod->get_list(0, true);
             $gcategories = $gcategory;
             foreach ($gcategory as $val) {
                 $result = $gcategory_mod->get_list($val['cate_id'], true);
                 $result = array_slice($result, 0, $this->options['amount']);
                 $gcategories = array_merge($gcategories, $result);
             }
         }
         import('tree.lib');
         $tree = new Tree();
         $tree->setTree($gcategories, 'cate_id', 'parent_id', 'cate_name');
         $data = array('gcategories' => $tree->getArrayList(0), 'model_name' => $this->options['model_name'], 'brands' => $brand_mod->find(array('conditions' => "recommended = 1 AND if_show = 1", 'order' => 'sort_order', 'limit' => $this->_num)));
         $cache_server->set($key, $data, $this->_ttl);
     }
     return $data;
 }
开发者ID:dongfeihu,项目名称:estore,代码行数:28,代码来源:main.widget.php

示例3: intval

 function _get_data()
 {
     $this->options['amount'] = intval($this->options['amount']);
     $cache_server =& cache_server();
     $key = $this->_get_cache_id();
     $data = $cache_server->get($key);
     if ($data === false) {
         $gcategory_mod =& bm('gcategory', array('_store_id' => 0));
         $gcategories = array();
         if (empty($this->options['amount'])) {
             $gcategories = $gcategory_mod->get_list(-1, true);
         } else {
             $gcategory = $gcategory_mod->get_list(0, true);
             $gcategories = $gcategory;
             foreach ($gcategory as $val) {
                 $result = $gcategory_mod->get_list($val['cate_id'], true);
                 $result = array_slice($result, 0, $this->options['amount']);
                 $gcategories = array_merge($gcategories, $result);
             }
         }
         import('tree.lib');
         $tree = new Tree();
         //LLL 商品分类挂件根据语言选择分类字段
         $lang2 = get_lang2();
         //like fr,sc etc...
         $gcategories = chg_array2_string($gcategories, 'cate_name', $lang2);
         $tree->setTree($gcategories, 'cate_id', 'parent_id', 'cate_name');
         $data = $tree->getArrayList(0);
         $cache_server->set($key, $data, $this->_ttl);
     }
     return $data;
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:32,代码来源:main.widget.php

示例4: getAreaTreeList

 public static function getAreaTreeList($city_id = 11)
 {
     //返回完整列表
     $list = self::getAllList($city_id);
     $tree = new Tree();
     $tree->setTree($list, 'TypeId', 'ParentId', 'TypeName', true);
     return $tree->getArrayList();
 }
开发者ID:emilymwang8,项目名称:cms,代码行数:8,代码来源:Advert.php

示例5: m

 function _list_scategory()
 {
     $scategory_mod =& m('scategory');
     $scategories = $scategory_mod->get_list(-1, true);
     import('tree.lib');
     $tree = new Tree();
     $tree->setTree($scategories, 'cate_id', 'parent_id', 'cate_name');
     return $tree->getArrayList(0);
 }
开发者ID:zhangxiaoling,项目名称:ecmall,代码行数:9,代码来源:category.app.php

示例6: m

 function _list_scategory()
 {
     $scategory_mod =& m('scategory');
     $scategories = $scategory_mod->get_list(-1, true);
     import('tree.lib');
     $tree = new Tree();
     $lang2 = get_lang2();
     //LLL 获取语言2个字母的代称,如fr, sc, en
     $scategories = chg_array2_string($scategories, 'cate_name', $lang2);
     //保留数组第二维字段字符串中指定语言的部分
     $tree->setTree($scategories, 'cate_id', 'parent_id', 'cate_name');
     return $tree->getArrayList(0);
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:13,代码来源:category.app.php

示例7: bm

 function _get_store_gcategory()
 {
     $gcategory_mod =& bm('gcategory', array('_store_id' => $this->_store_id));
     $gcategories = $gcategory_mod->get_list(-1, true);
     import('tree.lib');
     $tree = new Tree();
     $tree->setTree($gcategories, 'cate_id', 'parent_id', 'cate_name');
     return $tree->getArrayList(0);
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:9,代码来源:frontend.base.php

示例8: bm

 function _get_store_gcategory()
 {
     $gcategory_mod =& bm('gcategory', array('_store_id' => $this->_store_id));
     $gcategories = $gcategory_mod->get_list(-1, true);
     //LLL store gcategories里面的cate_name部分仅保留对应语言的字符 frontend.base, store中的商品分类
     $gcategories = chg_array2_string($gcategories, 'cate_name', get_lang2());
     import('tree.lib');
     $tree = new Tree();
     $tree->setTree($gcategories, 'cate_id', 'parent_id', 'cate_name');
     return $tree->getArrayList(0);
 }
开发者ID:BGCX261,项目名称:zhou3liu-svn-to-git,代码行数:11,代码来源:frontend.base.php


注:本文中的Tree::getArrayList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。