【新手求助】循环显示某区域下店铺列表挂件错误求助

2016-07-07 16:48 来源:www.chinab4c.com 作者:ecshop专家

各位大侠好,我刚学用这套商城系统,现在自己仿写了一个挂件,但加载不了,也没有提示什么错误,请高手帮忙解决,谢谢。
比如我想循环显示某省下的所有市的店铺信息。格式如下:

A市
店铺1店铺2 店铺3……
B市
店铺11 店铺22 店铺33……
C市
……
挂件代码如下:
function _get_data()
{
$this->options['num'] = intval($this->options['num']);
$cache_server =& cache_server();
$key = $this->_get_cache_id();
$data = $cache_server->get($key);
if($data === false)
{
$region_mod =& bm('region');
$store_mod = & bm('store');
//查找343省份
$regions = $region_mod->get_list(343);
foreach ($regions as $region)
{
$result = $store_mod->find(array(
'conditions' => "state = 1 AND region_id = ".$region['region_id'],
'order' => 'sort_order',
'fields' => 'store_id, store_name, store_logo, praise_rate, user_name',
'join' => 'belongs_to_user',
'limit' => $this->options['num'],
));
$goods_mod =& m('goods');
foreach ($result as $key => $store)
{
$result[$key]['goods_count'] = $goods_mod->get_count_of_store($store['store_id']);
empty($store['store_logo']) && $result[$key]['store_logo'] = Conf::get('default_store_logo');
}
// $result = $store_mod->get_list($region['region_id']);
//if(!empty($this->options['num']))
//$result = array_slice($result, 0, $this->options['num']);
$regions = array_merge($regions, $result);
}
import('tree.lib');
$tree = new Tree();
$tree->setTree($regions, 'region_id', 'parent_id', 'region_name');

$data = $tree->getArrayList(0);
$cache_server->set($key, $data, $this->_ttl);
}