...
|
...
|
@@ -61,6 +61,46 @@ class ShopModel |
|
|
exit();
|
|
|
}
|
|
|
|
|
|
$sknList = array();
|
|
|
|
|
|
if (isset($data['newArrivel']['list'])) {
|
|
|
foreach ($data['newArrivel']['list'] as $prod) {
|
|
|
$sknList[] = $prod['productSkn'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($data['hotSingle']['list'])) {
|
|
|
foreach ($data['hotSingle']['list'] as $prod) {
|
|
|
$sknList[] = $prod['productSkn'];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$sknProList = SearchData::searchAll(array('query' => join(',', array_unique($sknList))));
|
|
|
|
|
|
if (isset($sknProList['data']['product_list'])) {
|
|
|
$coverList = array();
|
|
|
|
|
|
$proList = HelperSearch::getProductList($sknProList['data']['product_list'], array(
|
|
|
'imgSize' => array(250, 250),
|
|
|
'defaultCover' => true
|
|
|
));
|
|
|
|
|
|
foreach ($proList as $prod) {
|
|
|
$coverList[$prod['skn']] = $prod['thumb'];
|
|
|
}
|
|
|
|
|
|
foreach ($data['newArrivel']['list'] as &$v) {
|
|
|
if (isset($coverList[$v['product_skn']])) {
|
|
|
$v['img'] = $coverList[$v['product_skn']];
|
|
|
}
|
|
|
}
|
|
|
foreach ($data['hotSingle']['list'] as &$v) {
|
|
|
if (isset($coverList[$v['product_skn']])) {
|
|
|
$v['img'] = $coverList[$v['product_skn']];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//店铺介绍
|
|
|
$data['brandIntro'] = self::getIntro($shopId, $parameters['uid']);
|
|
|
|
...
|
...
|
@@ -87,7 +127,11 @@ class ShopModel |
|
|
}
|
|
|
|
|
|
// 组织模板数据
|
|
|
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
|
|
|
$result = HelperSearch::getList($res, array_merge(
|
|
|
array('defaultCover' => true),
|
|
|
$searchCondition['options']
|
|
|
), $searchCondition['userInput']);
|
|
|
|
|
|
$data['pathNav'] = array_merge(
|
|
|
HelperSearch::$listNav,
|
|
|
array(
|
...
|
...
|
@@ -169,7 +213,10 @@ class ShopModel |
|
|
}
|
|
|
|
|
|
// 组织模板数据
|
|
|
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
|
|
|
$result = HelperSearch::getList($res, array_merge(
|
|
|
array('defaultCover' => true),
|
|
|
$searchCondition['options']
|
|
|
), $searchCondition['userInput']);
|
|
|
|
|
|
$data['goods'] = $result['goods'];
|
|
|
$data['opts'] = $result['opts'];
|
...
|
...
|
@@ -699,6 +746,7 @@ class ShopModel |
|
|
public static function getResourceData($data, $shopId)
|
|
|
{
|
|
|
$result = isset($data['resource_data']) ? json_decode($data['resource_data'], true) : array();
|
|
|
|
|
|
foreach ($result as $key => &$val) {
|
|
|
$val['url'] = self::modifyUrl($val, $shopId);
|
|
|
|
...
|
...
|
@@ -714,6 +762,7 @@ class ShopModel |
|
|
|
|
|
if (!isset($val['data']) && is_array($val)) {
|
|
|
foreach ($val as $k1 => &$v1) {
|
|
|
if (is_array($v1)) {
|
|
|
$url = self::modifyUrl($v1, $shopId);
|
|
|
if (!empty($url)) {
|
|
|
$v1['url'] = $url;
|
...
|
...
|
@@ -721,6 +770,7 @@ class ShopModel |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
$data['resource_data'] = $result;
|
|
|
return $data;
|
...
|
...
|
|