...
|
...
|
@@ -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']) && !empty($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['productSkn']])) {
|
|
|
$v['img'] = $coverList[$v['productSkn']];
|
|
|
}
|
|
|
}
|
|
|
foreach ($data['hotSingle']['list'] as &$v) {
|
|
|
if (isset($coverList[$v['productSkn']])) {
|
|
|
$v['img'] = $coverList[$v['productSkn']];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
//店铺介绍
|
|
|
$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'];
|
...
|
...
|
@@ -182,9 +229,33 @@ class ShopModel |
|
|
array('href' => '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
|
|
|
)
|
|
|
);
|
|
|
// $data['name'] = '全部商品 ALL';
|
|
|
// $sort = self::getSort($res['sort']);
|
|
|
// $data['goodsMenu']['menuList'] = $sort;
|
|
|
|
|
|
// 搜索无商品时显示全部商品
|
|
|
if (isset($searchCondition['condition']['query']) &&
|
|
|
!empty($searchCondition['condition']['query']) &&
|
|
|
empty($data['goods'])) {
|
|
|
$data['searchEmpty'] = true;
|
|
|
|
|
|
unset($searchCondition['condition']['query']);
|
|
|
$allProUrl = array('product' => SearchData::getProductUrl($searchCondition['condition']));
|
|
|
|
|
|
//批量调接口获取数据
|
|
|
$allRes = Yohobuy::getMulti($allProUrl);
|
|
|
|
|
|
$allResult = HelperSearch::getList($allRes, array_merge(
|
|
|
array('defaultCover' => true),
|
|
|
$searchCondition['options']
|
|
|
), $searchCondition['userInput']);
|
|
|
|
|
|
$sort = self::getSort($res['sort'], $parameters['options']['misort'], $shopId);
|
|
|
$param = array_merge($searchCondition['userInput'], array('navBar' => 1, 'shopId' => $shopId));
|
|
|
|
|
|
$data['allGoods']['name'] = '全部商品 ALL';
|
|
|
$data['allGoods']['list'] = $allResult['goods'];
|
|
|
$data['allGoods']['opts'] = $allResult['opts'];
|
|
|
$data['allGoods']['goodsMenu']['menuList'] = $sort;
|
|
|
$data['allGoods']['goodsMenu']['url'] = self::$shopListUrl . '?' . http_build_query($param);
|
|
|
}
|
|
|
|
|
|
return $data;
|
|
|
|
...
|
...
|
@@ -699,6 +770,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,9 +786,11 @@ class ShopModel |
|
|
|
|
|
if (!isset($val['data']) && is_array($val)) {
|
|
|
foreach ($val as $k1 => &$v1) {
|
|
|
$url = self::modifyUrl($v1, $shopId);
|
|
|
if (!empty($url)) {
|
|
|
$v1['url'] = $url;
|
|
|
if (is_array($v1)) {
|
|
|
$url = self::modifyUrl($v1, $shopId);
|
|
|
if (!empty($url)) {
|
|
|
$v1['url'] = $url;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
|