Authored by hf

code review by fei.hong: do merge yang.yang and shaofeng.zhou fixes bugs codes

... ... @@ -359,6 +359,7 @@ class SearchData
's_n_desc' => 'sales_num:desc',
'activities_id_desc' => 'activities.activity_id:desc',
'activities_id_asc' => 'activities.activity_id:asc',
'brand_desc' => 'brand_weight:desc'
);
$param = array();
$param['status'] = 1; // 是否上架,1表示在架,2表示不在
... ...
... ... @@ -1413,35 +1413,11 @@ class HelperSearch
//组织静态资源数据格式
public static function getNodeContent($code)
{
$result = array();
$nodeContent = BrandData::getByNodeContent($code); //TODO异步
if (isset($nodeContent['code']) && $nodeContent['code'] === 200) {
$result = array();
//print_r($nodeContent['data']);
$arr = explode('<br />', $nodeContent['data']);
$arr = array_values($arr);
$hrefPatten = "/<a href=[\'\"]?([^\'\" ]+).*?>/";
$pattern = "/[img|IMG].*?src=['|\"](.*?(?:[.gif|.jpg]))['|\"].*?[\/]?>/";
foreach($arr as $key => $value){
preg_match($hrefPatten, $value, $href);
preg_match($pattern, $value, $img);
if (isset($href[1])) {
$result[$key]['href'] = str_replace('&amp;', '&', $href[1]);
}
if (isset($img[1])) {
if (strrchr($img[1], '.swf') == '.swf') {
$result[$key]['isVedio'] = true;
$result[$key]['src'] = $img[1];
}else{
$result[$key]['src'] = $img[1];
}
}
}
return $result;
return $nodeContent['data'];
}
}
... ...
... ... @@ -88,4 +88,10 @@
{{/each}}
</ul>
{{/ picLink}}
{{#if cardHtml}}
<div class="brand-card">
{{{cardHtml}}}
</div>
{{/if}}
{{/ leftContent}}
... ...
... ... @@ -33,7 +33,7 @@ class IndexController extends WebAction
//传品牌ID参数
$condition = array();
$condition['brand'] = isset($result['brandId']) ? $result['brandId'] : '';
$condition['order'] = 'brand_desc';
//品牌系列参数
$condition['folder_id'] = $this->get('folder_id');
... ...