...
|
...
|
@@ -7,6 +7,7 @@ use LibModels\Web\Product\BrandData; |
|
|
use LibModels\Web\Product\SearchData;
|
|
|
use Api\Yohobuy;
|
|
|
use Api\Sign;
|
|
|
use Configs\ChannelConfig;
|
|
|
/**
|
|
|
* 搜索辅助类
|
|
|
*/
|
...
|
...
|
@@ -105,8 +106,8 @@ class HelperSearch |
|
|
}
|
|
|
}
|
|
|
//品牌店铺信息
|
|
|
if (isset($data['shop']) && !empty($data['shop'])) {
|
|
|
$result['shopEntry'] = self::shop($data['shop'], $data['sort']['sort']);
|
|
|
if (isset($data['shop']) && !empty($data['shop']) && isset($data['shopSort'])) {
|
|
|
$result['shopEntry'] = self::shop($data['shop'], $data['shopSort']);
|
|
|
}
|
|
|
//分页
|
|
|
if (isset($result['totalCount'])) {
|
...
|
...
|
@@ -167,7 +168,7 @@ class HelperSearch |
|
|
'isNew' => $isNew,
|
|
|
'isLimit' => $isLimit
|
|
|
),
|
|
|
'url' => sprintf('%s?channel=%s&from=%s-n_%s', $goods_list[0]['url'], 'product' , 'product', ++$key),
|
|
|
'url' => self::fromPram($goods_list[0]['url'],++$key),
|
|
|
'thumb' => $val['default_images'],
|
|
|
'name' => $val['product_name'],
|
|
|
'salePrice' => $val['sales_price'],
|
...
|
...
|
@@ -176,8 +177,6 @@ class HelperSearch |
|
|
'showColBtn' => true,
|
|
|
'coled' => true
|
|
|
);
|
|
|
print_r($_COOKIE);
|
|
|
print_r($good); exit;
|
|
|
//市场价不等于售价时显示
|
|
|
if ($val['market_price'] != $val['sales_price']) {
|
|
|
$good['marketPrice'] = $val['market_price'];
|
...
|
...
|
@@ -1374,12 +1373,24 @@ class HelperSearch |
|
|
|
|
|
/**
|
|
|
* 商品链接from参数
|
|
|
* @param $url
|
|
|
* @param $position
|
|
|
* @param bool $abEnabled
|
|
|
* @return string
|
|
|
*/
|
|
|
public static function fromPram($url, $abEnabled = false)
|
|
|
public static function fromPram($url, $position, $abEnabled = false)
|
|
|
{
|
|
|
$options = self::$options;
|
|
|
$itemFrom = ChannelConfig::$itemFromStats;
|
|
|
$controller = isset(self::$options['controller']) ? strtolower(self::$options['controller']) : '';
|
|
|
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
|
|
|
$itemIndex = $controller."_".$action;
|
|
|
//获取domain-module-$keyword_page_position{ab}
|
|
|
$ab = (isset($_COOKIE['ab_5']) && $abEnabled == true) ? '_'.$_COOKIE['ab_5'] : '';
|
|
|
$url .= "?from={$domain}-{$module}-{$module_id}_{$page}_{$position}{$ab}";
|
|
|
|
|
|
$page = self::$page;
|
|
|
$keyword = isset(self::$options['query']) ? self::$options['query'] : '';
|
|
|
if (isset($itemFrom[$itemIndex])) {
|
|
|
$url .= "?from={$itemFrom[$itemIndex]['domain']}-{$itemFrom[$itemIndex]['module']}-{$keyword}_{$page}_{$position}{$ab}";
|
|
|
}
|
|
|
return $url;
|
|
|
}
|
|
|
} |
...
|
...
|
|