Authored by weiqingting

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -133,6 +133,7 @@ class SearchData extends \LibModels\Wap\Product\SearchData
return Yohobuy::get(self::getUrl('search'), $param, $cache);
}
/**
* 根据分类列表获取商品信息
*
... ... @@ -157,20 +158,48 @@ class SearchData extends \LibModels\Wap\Product\SearchData
// }
// return $data;
/* 2016/01/26 code review by fei.hong: 优化合并misort参数, 减少调用搜索的次数 */
$sortIds = '';
$viewNum = 0;
foreach ($sortList as $value) {
$viewNum += intval($value['viewNum']);
$sortIds .= $value['misort'] . ',';
/* code review by fei.hong: 2016/01/26 优化合并misort参数, 减少调用搜索接口的次数 */
$data = array();
// 按照时间降序排的参数
$params['order'] = 'shelve_time:desc';
// 获取新品的接口URL,以数组列表返回
$urlList = self::getNewArrivalUrl($sortList, $params);
// 并行调用搜索新品接口
$searchd = Yohobuy::getMulti($urlList);
// 该变量用于记录数组最后一个值的索引
$lastIndex = 0;
// 业务逻辑:按照指定品类排序显示
foreach ($sortList as $key => $value) {
$lastIndex = $value['viewNum'] - 1;
// 业务逻辑:一个品类不满指定个数时,前台不显示
if (!empty($searchd[$key]) && isset($searchd[$key]['product_list'][$lastIndex])) {
$data = array_merge($data, $searchd[$key]['product_list']);
}
}
$params['viewNum'] = $viewNum;
$params['misort'] = rtrim($sortIds, ',');
$searchd = self::searchElasticByCondition($params);
if (empty($searchd['data']['product_list'])) {
return array();
// 用完清空不使用的变量
$searchd = array();
return $data;
}
/**
* 获取推荐新品的接口URL列表
*
* @param array $sortList 分类列表
* @param array $params 附加参数
* @return arary
*/
public static function getNewArrivalUrl($sortList, $params)
{
$urlList = array();
$option = array();
foreach ($sortList as $key => $value) {
$option = $params + $value;
$urlList[$key] = Yohobuy::httpBuildQuery(self::getUrl('search'), $option);
}
return $searchd['data']['product_list'];
return $urlList;
}
/**
... ...
<?php
namespace WebPlugin\DataProcess;
class Channel
... ... @@ -13,7 +14,7 @@ class Channel
public static function getFormat($channel, $data)
{
if(empty($data)) {
if (empty($data)) {
return array();
}
// 通用处理器
... ... @@ -28,4 +29,5 @@ class Channel
ksort($result);
return array_values($result);
}
}
... ...
<?php
namespace WebPlugin\DataProcess\Channel;
abstract class AbstractChannel
{
/***
/* * *
* 处理数据
* @param array $resource
* @return array[以key方式存储数据]
*/
public static function format($resource){}
public static function format($resource)
{
}
/**
* 获取格式化最新上架数据
*
... ... @@ -18,20 +24,16 @@ abstract class AbstractChannel
public static function getFormatNewArrivals(&$resource)
{
$result = array();
foreach($resource as $key => $val)
{
if(isset($resource[$key]) && isset($resource[$key + 2]))
{
foreach ($resource as $key => $val) {
if (isset($resource[$key]) && isset($resource[$key + 2])) {
$temp = array('newArrivls' => array('name' => '', 'navs' => array()), 'href' => '');
//newArrivals
if($resource[$key]['template_name'] == 'text' && $resource[$key + 1]['template_name'] == 'textNav')
{
if ($resource[$key]['template_name'] == 'text' && $resource[$key + 1]['template_name'] == 'textNav') {
//text模版
$temp['newArrivls']['name'] = $resource[$key]['data']['text'];
//textNav模版
foreach($resource[$key + 1]['data'] as $val)
{
$temp['newArrivls']['navs'][] = array('href' => $val['url'],'name' => $val['name']);
foreach ($resource[$key + 1]['data'] as $val) {
$temp['newArrivls']['navs'][] = array('href' => $val['url'], 'name' => $val['name']);
}
//link模版
$temp['href'] = $resource[$key + 2]['data'][0]['url'];
... ... @@ -42,4 +44,5 @@ abstract class AbstractChannel
}
return $result;
}
}
\ No newline at end of file
}
... ...
<?php
namespace WebPlugin\DataProcess\Channel;
class Boys extends AbstractChannel
{
/**
* 格式化数据
*
... ... @@ -13,4 +16,5 @@ class Boys extends AbstractChannel
$result = self::getFormatNewArrivals($resource);
return $result;
}
}
\ No newline at end of file
}
... ...
<?php
namespace WebPlugin\DataProcess\Channel;
class Girls extends AbstractChannel
{
public static function format($resource)
{
$result = array();
$result += self::getFormatNewArrivals($resource);
foreach($resource as $key => $val)//老版是title模版
{
if(isset($resource[$key]) && isset($resource[$key + 2]))
{
foreach ($resource as $key => $val) {//老版是title模版
if (isset($resource[$key]) && isset($resource[$key + 2])) {
$temp = array('newArrivls' => array('name' => '', 'navs' => array(), 'href' => ''));
if($resource[$key]['template_name'] == 'text' &&
$resource[$key + 1]['template_name'] == 'title' && //老版是title模版
$resource[$key + 2]['template_name'] == 'link'
)
{
if ($resource[$key]['template_name'] == 'text' &&
$resource[$key + 1]['template_name'] == 'title' && //老版是title模版
$resource[$key + 2]['template_name'] == 'link'
) {
//text模版
$temp['newArrivls']['name'] = $resource[$key]['data']['text'];
//title模版
foreach($resource[$key + 1]['data']['nav'] as $val)
{
$temp['newArrivls']['navs'][] = array('href' => $val['url'],'name' => $val['name']);
foreach ($resource[$key + 1]['data']['nav'] as $val) {
$temp['newArrivls']['navs'][] = array('href' => $val['url'], 'name' => $val['name']);
}
$link = $resource[$key + 2]['data'][0];
$temp['newArrivls']['href'] = $link['url'];
$temp['newArrivls']['href'] = $link['url'];
unset($resource[$key], $resource[$key + 1]);
$result[$key] = $temp;
}
... ... @@ -32,4 +31,5 @@ class Girls extends AbstractChannel
}
return $result;
}
}
... ...
<?php
namespace WebPlugin\DataProcess\Channel;
class Kids extends AbstractChannel
{
/**
* 格式化数据
*
... ... @@ -12,20 +15,16 @@ class Kids extends AbstractChannel
{
$result = array();
$result += self::getFormatNewArrivals($resource);
foreach($resource as $key => $val)//老版处理
{
if(isset($resource[$key]) && isset($resource[$key + 1]))
{
foreach ($resource as $key => $val) {//老版处理
if (isset($resource[$key]) && isset($resource[$key + 1])) {
$temp = array('newArrivls' => array('name' => '', 'navs' => array()));
//newArrivals
if($resource[$key]['template_name'] == 'text' && $resource[$key + 1]['template_name'] == 'textNav')
{
if ($resource[$key]['template_name'] == 'text' && $resource[$key + 1]['template_name'] == 'textNav') {
//text模版
$temp['newArrivls']['name'] = $resource[$key]['data']['text'];
//textNav模版
foreach($resource[$key + 1]['data'] as $val)
{
$temp['newArrivls']['navs'][] = array('href' => $val['url'],'name' => $val['name']);
foreach ($resource[$key + 1]['data'] as $val) {
$temp['newArrivls']['navs'][] = array('href' => $val['url'], 'name' => $val['name']);
}
unset($resource[$key], $resource[$key + 1]);
$result[$key] = $temp;
... ... @@ -35,5 +34,4 @@ class Kids extends AbstractChannel
return $result;
}
}
\ No newline at end of file
}
... ...
<?php
namespace WebPlugin\DataProcess\Channel;
class Lifestyle extends AbstractChannel
{
/**
* 格式化数据
*
... ... @@ -12,20 +15,16 @@ class Lifestyle extends AbstractChannel
{
$result = array();
$result += self::getFormatNewArrivals($resource);
foreach($resource as $key => $val)//老版处理
{
if(isset($resource[$key]) && isset($resource[$key + 1]))
{
foreach ($resource as $key => $val) {//老版处理
if (isset($resource[$key]) && isset($resource[$key + 1])) {
$temp = array('newArrivls' => array('name' => '', 'navs' => array()));
//newArrivals
if($resource[$key]['template_name'] == 'textNav' && $resource[$key + 1]['template_name'] == 'link')
{
if ($resource[$key]['template_name'] == 'textNav' && $resource[$key + 1]['template_name'] == 'link') {
//text模版
$temp['newArrivls']['name'] = '最新上架 NEW ARRIVALS';
//textNav模版
foreach($resource[$key]['data'] as $val)
{
$temp['newArrivls']['navs'][] = array('href' => $val['url'],'name' => $val['name']);
foreach ($resource[$key]['data'] as $val) {
$temp['newArrivls']['navs'][] = array('href' => $val['url'], 'name' => $val['name']);
}
unset($resource[$key], $resource[$key + 1]);
$result[$key] = $temp;
... ... @@ -34,4 +33,5 @@ class Lifestyle extends AbstractChannel
}
return $result;
}
}
\ No newline at end of file
}
... ...
<?php
namespace WebPlugin\DataProcess;
use WebPlugin\Images;
... ... @@ -12,6 +13,7 @@ use LibModels\Web\Product\SearchData;
*/
class Process
{
/**
*
* @param array $data
... ... @@ -21,15 +23,16 @@ class Process
{
// 组合处理数据
$result = self::mergeProcess($data, $type);
$build = array();
foreach ($data as $key => $val) {
$fun = $val['template_name'];
if (empty($val['data']) || ! is_callable("self::$fun")) {
if (empty($val['data']) || !is_callable("self::$fun")) {
continue;
}
// 单个处理数据
$build = self::$fun($val, $type);
if (! empty($build)) {
if (!empty($build)) {
$result[$key] = $build;
unset($data[$key]);
}
... ... @@ -62,7 +65,7 @@ class Process
}
$len = count($data['menuNav']['blocks']);
foreach ($data['menuNav']['blocks'] as $key => $val) {
if($len <= 2 && $key == 0) {
if ($len <= 2 && $key == 0) {
$val['img'] = Images::getImageUrl($val['img'], 185, 152, 1);
}
$val['img'] = Images::getImageUrl($val['img'], 185, 76, 1);
... ... @@ -73,7 +76,7 @@ class Process
'img' => $val['img']
);
}
foreach ($data['menuNav']['list'] as $val) {
if (empty($val['name']) && empty($val['url'])) {
continue;
... ... @@ -84,7 +87,7 @@ class Process
'href' => $val['url']
);
}
foreach ($data['imgs'] as $key => $val) {
$val['url'] = Helpers::transUrl($val['url'], $type);
if ($key == 0) {
... ... @@ -118,19 +121,16 @@ class Process
{
$result = array();
$temp = array();
$width = 1150;
$height = 450;
if ($data['focus_type'] == 1) {
foreach ($data['data'] as $val) {
$ret = array();
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 1);
$val['src'] = Images::getImageUrl($val['src'], 1150, 450, 1);
$val['url'] = Helpers::transUrl($val['url'], $type);
$ret = array (
$ret = array(
'href' => $val['url'],
'img' => $val['src'],
);
if(!empty($val['bgColor'])) {
$ret['bgColor'] = $val['bgColor'];
if (!empty($val['bgColor'])) {
$ret['bgColor'] = $val['bgColor'];
}
$temp[] = $ret;
}
... ... @@ -152,21 +152,17 @@ class Process
$temp = array();
if ($data['template_name'] == 'recommend_content_three') {
foreach ($data['data']['big_image'] as $val) {
$width = 1150;
$height = 450;
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 1);
$val['src'] = Images::getImageUrl($val['src'], 1150, 450, 1);
$val['url'] = Helpers::transUrl($val['url'], $type);
$temp['list'][] = array(
'href' => $val['url'],
'img' => $val['src'],
// 'bgColor'=> $val[]
// 'bgColor'=> $val[]
);
}
foreach ($data['data']['list'] as $val) {
$width = 138;
$height = 54;
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 1);
$val['src'] = Images::getImageUrl($val['src'], 138, 54, 1);
$val['url'] = Helpers::transUrl($val['url'], $type);
$temp['pagination'][] = array(
'href' => $val['url'],
... ... @@ -270,11 +266,12 @@ class Process
'mergeGirlkidsData',
'mergeHotBrandsData'
);
$temp = array();
foreach ($data as $key => $val) {
foreach ($mergeProcessList as $merge) {
if (isset($data[$key])) {
$temp = self::$merge($key, $data, $type);
if (! empty($temp)) {
if (!empty($temp)) {
$result[$key] = $temp;
}
}
... ... @@ -298,43 +295,35 @@ class Process
public static function mergeSinglehotData($key, array &$data, $type)
{
$result = array();
if ((isset($data[$key]) && isset($data[$key + 2])) || (isset($data[$key]) && isset($data[$key + 3])))
{
if ((isset($data[$key]) && isset($data[$key + 2])) || (isset($data[$key]) && isset($data[$key + 3]))) {
$title = '';
$source = $goods = $floor = array();
if ($data[$key]['template_name'] == 'textNav' && $data[$key + 1]['template_name'] == 'goods'
&& $data[$key + 2]['template_name'] == 'floor')
{
if ($data[$key]['template_name'] == 'textNav' && $data[$key + 1]['template_name'] == 'goods' && $data[$key + 2]['template_name'] == 'floor') {
$title = '人气单品 TOP100';
$source = $data[$key];
$goods = $data[$key + 1];
$floor = $data[$key + 2];
unset($data[$key], $data[$key + 1], $data[$key + 2]);
} else if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav'
&& $data[$key + 2]['template_name'] == 'goods' && $data[$key + 3]['template_name'] == 'floor')
{
} else if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav' && $data[$key + 2]['template_name'] == 'goods' && $data[$key + 3]['template_name'] == 'floor') {
$title = $data[$key]['data']['text'];
$source = $data[$key + 1];
$goods = $data[$key + 2];
$floor = $data[$key + 3];
unset($data[$key], $data[$key + 1], $data[$key + 2], $data[$key + 3]);
} else if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav'
&& $data[$key + 2]['template_name'] == 'goods' && $data[$key + 3]['template_name'] == 'app_icon_list')
{
} else if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav' && $data[$key + 2]['template_name'] == 'goods' && $data[$key + 3]['template_name'] == 'app_icon_list') {
$title = $data[$key]['data']['text'];
$source = $data[$key + 1];
$goods = $data[$key + 2];
$floor = $data[$key + 3];
unset($data[$key], $data[$key + 1], $data[$key + 2], $data[$key + 3]);
}
if (! empty($source) && ! empty($floor))
{
if (!empty($source) && !empty($floor)) {
$result = array(
'singlehot' => array(
'name' => '',
'imgHot' => array(),
'brands' => array(),
'navs'=> array(),
'navs' => array(),
)
);
// text模版
... ... @@ -367,9 +356,7 @@ class Process
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 2])) {
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'small_pic'
&& $data[$key + 2]['template_name'] == 'floor')
{
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'small_pic' && $data[$key + 2]['template_name'] == 'floor') {
$result = array(
'singlehot' => array(
'name' => '',
... ... @@ -379,40 +366,27 @@ class Process
// text
$result['singlehot']['name'] = $data[$key]['data']['text'];
$len = 10;
$list = array();
// small_pic
foreach ($data[$key + 1]['data'] as &$val) {
$w = 378;
$h = 248;
$val['src'] = Images::getImageUrl($val['src'], $w, $h, 1);
$val['src'] = Images::getImageUrl($val['src'], 378, 248, 1);
}
//floor
foreach ($data[$key + 2]['data'] as &$val)
{
$w = 185;
$h = 248;
$val['src'] = Images::getImageUrl($val['src'], $w, $h, 1);
foreach ($data[$key + 2]['data'] as &$val) {
$val['src'] = Images::getImageUrl($val['src'], 185, 248, 1);
}
for ($i = 0; $i < $len; $i ++)
{
for ($i = 0; $i < $len; $i ++) {
$pos = $i;
if ($i == 1)
{
if ($i == 1) {
$val = $data[$key + 1]['data'][0]; // 第二个是大图
}
else if ($i == $len - 1)
{
} else if ($i == $len - 1) {
$val = $data[$key + 1]['data'][1]; // 最后一个是大图
}
else
{
if ($pos > 1) // 小图
{
} else {
if ($pos > 1) { // 小图
$pos = $pos - 1;
}
$val = $data[$key + 2]['data'][$pos];
}
$result['singlehot']['imgHot'][] = array(
'href' => $val['url'],
'img' => $val['src'],
... ... @@ -437,16 +411,14 @@ class Process
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 2])) {
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'focus'
&& ($data[$key + 2]['template_name'] == 'floor' ||
$data[$key + 2]['template_name'] == 'app_icon_list'))
{
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'focus' && ($data[$key + 2]['template_name'] == 'floor' ||
$data[$key + 2]['template_name'] == 'app_icon_list')) {
//slider颜色
$sliderColor = array('girls' => '#8ae6e0','kids'=>'#7AD3F8','lifestyle'=>'#4e433d', 'boys'=>'');
$sliderColor = array('girls' => '#8ae6e0', 'kids' => '#7AD3F8', 'lifestyle' => '#4e433d', 'boys' => '');
$result = array(
'preferenceBrands' => array(
'name' => '',
'sliderColor'=> $sliderColor[$type],
'sliderColor' => $sliderColor[$type],
'imgBrand' => array(),
'brandUrl' => ''
)
... ... @@ -454,11 +426,15 @@ class Process
// text模版
$result['preferenceBrands']['name'] = $data[$key]['data']['text'];
// focus模版
$width = 0;
$height = 0;
foreach ($data[$key + 1]['data'] as $val) {
if($type == 'boys') {
$width = 378; $height = 175;
} else{
$width = 320;$height = 430;
if ($type == 'boys') {
$width = 378;
$height = 175;
} else {
$width = 320;
$height = 430;
}
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 1);
$val['url'] = Helpers::transUrl($val['url'], $type);
... ... @@ -487,10 +463,10 @@ class Process
$floor['moreBrand'] = $data[$key + 3]['data'][0]['url'];
unset($data[$key + 3]);
}
$type_key = sprintf("%s_%s", $type, $key + 2);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $type_key);
$typeKey = sprintf("%s_%s", $type, $key + 2);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $typeKey);
Cache::set($cacheKey, $floor, 86400);
$result['preferenceBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
$result['preferenceBrands']['brandUrl'] = Helpers::url('/common/getIndexResourceBrand', array('type' => $typeKey));
unset($data[$key], $data[$key + 1], $data[$key + 2]);
}
}
... ... @@ -508,10 +484,8 @@ class Process
public static function mergeGirlkidsData($key, array &$data, $type)
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 2]))
{
if ($data[$key]['template_name'] == 'text' && $data[$key + 2]['template_name'] == 'goods')
{
if (isset($data[$key]) && isset($data[$key + 2])) {
if ($data[$key]['template_name'] == 'text' && $data[$key + 2]['template_name'] == 'goods') {
$result = array(
'girlkids' => array(
'name' => '',
... ... @@ -520,13 +494,13 @@ class Process
);
// text
$result['girlkids']['name'] = $data[$key]['data']['text'];
// goods
$result['girlkids']['imgHot'] = self::mergeGoodsProcess($data[$key + 2], $type);
unset($data[$key], $data[$key + 1], $data[$key + 2]);
}
}
return $result;
}
... ... @@ -541,11 +515,8 @@ class Process
public static function mergeAccordionData($key, array &$data, $type)
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 2]))
{
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav'
&& $data[$key + 2]['template_name'] == 'focus')
{
if (isset($data[$key]) && isset($data[$key + 2])) {
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav' && $data[$key + 2]['template_name'] == 'focus') {
$result = array(
'accordion' => array(
'name' => '',
... ... @@ -554,12 +525,12 @@ class Process
)
);
$result['accordion']['name'] = $data[$key]['data']['text'];
// textNav模版
if (! empty($data[$key + 1]['data'])) {
if (!empty($data[$key + 1]['data'])) {
$result['accordion']['navs'] = self::mergeNavProcess($data[$key + 1], $type);
}
// focus模版
foreach ($data[$key + 2]['data'] as $val) {
$val['src'] = Images::getImageUrl($val['src'], 650, 400, 1);
... ... @@ -572,7 +543,7 @@ class Process
unset($data[$key], $data[$key + 1], $data[$key + 2]);
}
}
return $result;
}
... ... @@ -587,12 +558,9 @@ class Process
public static function mergeNewReportData($key, array &$data, $type)
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 3]))
{
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'single_image'
&& $data[$key + 2]['template_name'] == 'floor' &&
$data[$key + 3]['template_name'] == 'single_image')
{
if (isset($data[$key]) && isset($data[$key + 3])) {
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'single_image' && $data[$key + 2]['template_name'] == 'floor' &&
$data[$key + 3]['template_name'] == 'single_image') {
$result = array(
'newReport' => array(
'name' => '',
... ... @@ -604,18 +572,14 @@ class Process
// single_image & floor & single_image
$list = array_merge($data[$key + 1]['data'], array_slice($data[$key + 2]['data'], 0, 6), $data[$key + 3]['data']);
foreach ($list as $listKey => $val) {
$width = 185;
$height = 248;
$w = 377;
$h = 504;
if ($listKey == 0 || $listKey == 7) {
$val['src'] = Images::getImageUrl($val['src'], $w, $h, 1);
$val['src'] = Images::getImageUrl($val['src'], 377, 504, 1);
$result['newReport']['list'][] = array(
'href' => $val['url'],
'img' => $val['src']
);
} else {
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 1);
$val['src'] = Images::getImageUrl($val['src'], 185, 248, 1);
$result['newReport']['list'][] = array(
'href' => $val['url'],
'img' => $val['src']
... ... @@ -639,8 +603,7 @@ class Process
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 2])) {
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav'
&& $data[$key + 2]['template_name'] == 'floor') {
if ($data[$key]['template_name'] == 'text' && $data[$key + 1]['template_name'] == 'textNav' && $data[$key + 2]['template_name'] == 'floor') {
$result = array(
'category' => array(
'name' => '',
... ... @@ -650,16 +613,20 @@ class Process
);
// text模版
$result['category']['name'] = $data[$key]['data']['text'];
// textNav模版
if (! empty($data[$key + 1]['data'])) {
if (!empty($data[$key + 1]['data'])) {
$result['category']['navs'] = self::mergeNavProcess($data[$key + 1], $type);
}
// floor模版
$width = 0;
$height = 0;
foreach ($data[$key + 2]['data'] as $pos => $val) {
$width = 185; $height = 510;
if($pos == 1) {
$width = 377; $height = 504;
$width = 185;
$height = 510;
if ($pos == 1) {
$width = 377;
$height = 504;
}
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 2);
$val['url'] = Helpers::transUrl($val['url'], $type);
... ... @@ -672,7 +639,7 @@ class Process
unset($data[$key], $data[$key + 1], $data[$key + 2]);
}
}
return $result;
}
... ... @@ -687,10 +654,8 @@ class Process
public static function mergeHotCategoryData($key, &$data, $type)
{
$result = array();
if (isset($data[$key]) && isset($data[$key + 1]))
{
if ($data[$key]['template_name'] == 'hotCategory' && $data[$key + 1]['template_name'] == 'floor')
{
if (isset($data[$key]) && isset($data[$key + 1])) {
if ($data[$key]['template_name'] == 'hotCategory' && $data[$key + 1]['template_name'] == 'floor') {
$result = array(
'name' => '',
'navs' => array(),
... ... @@ -709,11 +674,9 @@ class Process
$result['navs'] = $temp['navs'];
$result['tplrecommend']['keyword'] = $temp['tplrecommend']['keyword'];
$result['tplrecommend']['category'] = $temp['tplrecommend']['category'];
foreach ($data[$key]['data']['imgs'] as $key2 => $val)
{
foreach ($data[$key]['data']['imgs'] as $key2 => $val) {
$val['url'] = Helpers::transUrl($val['url'], $type);
if ($key2 == 0 || $key2 == 4) // 两个大图
{
if ($key2 == 0 || $key2 == 4) { // 两个大图
$val['img'] = Images::getImageUrl($val['img'], 378, 248, 1); // 大图
$result['tplrecommend']['brands'][] = array(
'href' => $val['url'],
... ... @@ -729,10 +692,9 @@ class Process
);
}
}
// floor模版
foreach ($data[$key + 1]['data'] as $val)
{
foreach ($data[$key + 1]['data'] as $val) {
$val['src'] = Images::getImageUrl($val['src'], 222, 298, 1); // 小图
$result['tplrecommend']['products'][] = array(
'href' => $val['url'],
... ... @@ -746,7 +708,7 @@ class Process
);
}
}
return $result;
}
... ... @@ -761,8 +723,9 @@ class Process
{
$result = array();
foreach ($data['data'] as $val) {
if (empty($val))
if (empty($val)) {
continue;
}
$result[] = array(
'href' => $val['url'],
'name' => $val['name']
... ... @@ -784,16 +747,17 @@ class Process
$skns = '';
foreach ($data['data'] as $val) {
$skns .= $val['id'] . ' ';
}
}
$params = array(
'query' => rtrim($skns),
'client_type' => 'web'
);
$goodsList = SearchData::searchElasticByCondition($params, false);
$goodsList = $goodsList['data']['product_list'];
$goodsList = empty($goodsList) ? array() : $goodsList['data']['product_list'];
$pos = 0;
foreach ($goodsList as $goods)
{
$url = '';
$oneGoods = array();
foreach ($goodsList as $goods) {
$oneGoods = array();
$pos ++;
if ($pos > 12) {
... ... @@ -802,14 +766,14 @@ class Process
if (empty($goods)) {
continue;
}
$url = Helpers::getUrlBySkc($goods['product_id'], $goods['goods_list'][0]['goods_id'], $goods['cn_alphabet']);
$oneGoods['img'] = Images::getImageUrl($goods['goods_list'][0]['images_url'], 280, 373, 1);
$oneGoods['name'] = $goods['product_name'];
$oneGoods['price'] = $goods['sales_price'];
$url = Helpers::getUrlBySkc($goods['product_id'], $goods['goods_list'][0]['goods_id'], $goods['cn_alphabet']);
$oneGoods['href'] = Helpers::transUrl($url, $type);
$result[$goods['product_skn']] = $oneGoods;
}
// 排序
uksort($result, function ($a, $b) use($skns) {
$skn_arr = explode(' ', $skns);
... ... @@ -817,30 +781,27 @@ class Process
});
$pos = 1;
//添加TOP标示
foreach($result as &$val) {
if($pos < 4) {
$val['tip'] = 'TOP'.$pos;
}
else {
break;
}
$pos ++;
foreach ($result as &$val) {
if ($pos < 4) {
$val['tip'] = 'TOP' . $pos;
} else {
break;
}
$pos ++;
}
return $result;
}
/**
* 热门品牌数据处理
*
* @param array $data
* @param string $type
*/
public static function mergeHotBrandsData($key,array &$data,$type)
public static function mergeHotBrandsData($key, array &$data, $type)
{
$result = array();
$temp = array();
if ($data[$key]['template_name'] == 'custom_brands')
{
if ($data[$key]['template_name'] == 'custom_brands') {
$result = array(
'hotBrands' => array(
'name' => '',
... ... @@ -854,26 +815,23 @@ class Process
'logoBrand' => '',
'moreBrand' => ''
);
$brands = $data[$key]['data']['list'];
foreach ($brands as $val)
{
$width = 185;
$height = 86;
$val['src'] = Images::getImageUrl($val['src'], $width, $height, 2);
$val['url'] = Helpers::transUrl($val['url'], $type);
$floor['logoBrand'][] = array(
'href' => $val['url'],
'img' => $val['src']
);
}
$floor['moreBrand'] = 'http://yohobuy.com/brands';
$type_key = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $type_key);
foreach ($brands as $val) {
$val['src'] = Images::getImageUrl($val['src'], 185, 86, 2);
$val['url'] = Helpers::transUrl($val['url'], $type);
$floor['logoBrand'][] = array(
'href' => $val['url'],
'img' => $val['src']
);
}
$floor['moreBrand'] = Helpers::url('/brands');
$typeKey = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA, $typeKey);
Cache::set($cacheKey, $floor, 86400);
$result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
$result['hotBrands']['brandUrl'] = Helpers::url('/common/getIndexResourceBrand', array('type' => $typeKey));
}
return $result;
}
}
\ No newline at end of file
}
... ...
... ... @@ -191,19 +191,19 @@ class HelperSearch
$isSale = false;
}
$gender = 0;
if (isset(self::$options['gender'])) {
$genderArr = explode(',', self::$options['gender']);
if (isset(self::$params['gender'])) {
$genderArr = explode(',', self::$params['gender']);
$gender = $genderArr[0];
}
foreach($val['goods_list'] as $k => $v){
$goods_list[$k]['url'] = Helpers::getUrlBySkc($val['product_id'], $v['goods_id'], $val['cn_alphabet']);
//女封
if (isset($v['cover_1']) && $gender == 1) {
$val['default_images'] = $v['images_url'];
}
//男封
if (isset($v['cover_2']) && $gender == 2) {
$val['default_images'] = $v['images_url'];
if (isset($v['cover_1']) && !empty($v['cover_1']) && $gender == 1) {
$val['default_images'] = $v['cover_1'];
}
//女封
if (isset($v['cover_2']) && !empty($v['cover_2']) && $gender == 2) {
$val['default_images'] = $v['cover_2'];
}
//筛选符合颜色条件的封面图片
if (isset($params['color']) && $params['color'] == $v['color_id']) {
... ... @@ -232,6 +232,10 @@ class HelperSearch
'thumb' => $val['default_images'],
'name' => $val['product_name'],
'salePrice' => $val['sales_price'],
'brand' => array(
'url' => Helpers::url('', '', $val['brand_domain']),
'name' => $val['brand_name']
),
'isFew' => $isFew,
'skn' => $val['product_skn'],
'showColBtn' => true,
... ... @@ -492,7 +496,7 @@ class HelperSearch
$existName[] = $v['brand_name'];
}
if ($existBrandNum === 1){
$existName[]= substr($v['brand_name'], 0, 3).'...';
$existName[]= substr($v['brand_name'], 0, 4).'...';
}
$existBrandNum++;
}
... ... @@ -547,9 +551,30 @@ class HelperSearch
if (self::checkSearch('brand')) {
return array();
}
//品牌数量小于等于10,隐藏更多按钮
$result['showMulti'] = count($result['brandsShow']) > 1 ? true :false;
$result['showMore'] = count($result['brandsShow']) > 10 ? true :false;
//品牌数量等于1,设置为已选中
$totalBrand = count($result['brandsShow']);
if ($totalBrand == 1) {
if (!in_array($totalBrand, $brandIds)) {
//设置已选中
self::$selected['brand'] = array(
'name' => $result['brandsShow'][0]['name'],
'href' => self::buildUrl($params, array('brand', $result['brandsShow'][0]['href']))
);
$result['default'][0]['checked'] = true;
}
if (self::$options['controller'] == 'Search') {
return array();
}
}
//品牌数量大于1小于10,显示多选
elseif ($totalBrand > 1 && $totalBrand < 10) {
$result['showMulti'] = true;
}
//品牌数量大于10,显示多选、更多按钮
else {
$result['showMulti'] = true;
$result['showMore'] = true;
}
return $result;
}
/**
... ... @@ -1380,7 +1405,12 @@ class HelperSearch
$action = isset(self::$options['action']) ? strtolower(self::$options['action']) : '';
//列表页面
if ($controller == 'list' && $action == 'index') {
$type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : '';
if (isset(self::$params['misort'])) {
$type = self::$params['misort'];
}
elseif (isset(self::$params['msort'])) {
$type = self::$params['msort'];
}
}
//新品到着
elseif ($controller == 'list' && $action == 'new') {
... ...
... ... @@ -24,7 +24,7 @@ class Helpers
switch ($module) {
case 'default':
$url = 'http://m.yohobuy.com';
$url = 'http://www.yohobuy.com';
break;
case 'guang': // 逛
$url = 'http://guang' . SUB_DOMAIN;
... ...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="renderer" content="webkit">
<link rel="shortcut icon" href="http://www.yohobuy.com/favicon.ico" type="image/x-icon" />
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<title>{{title}}</title>
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
{{/if}}
{{#if preEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
{{/if}}
{{#if testEnv}}
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/yohobuy/{{version}}/index.css">
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="http://webstatic.dev.yohobuy.com/css/index.css">
{{/if}}
</head>
<body>
{{> layout/page-header}}
{{> layout/simple-header}}
\ No newline at end of file
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="renderer" content="webkit">
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<title>{{title}}</title>
<link rel="dns-prefetch" href="//cdn.yoho.cn">
<link rel="dns-prefetch" href="//static.yohobuy.com">
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
{{#if rlsEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
{{/if}}
{{#if preEnv}}
<link rel="stylesheet" href="http://cdn.yoho.cn/yohobuy/{{version}}/index.css">
{{/if}}
{{#if testEnv}}
<link rel="stylesheet" href="http://static.buy.test.yoho.cn/dist/yohobuy/{{version}}/index.css">
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="http://webstatic.dev.yohobuy.com/css/index.css">
{{/if}}
</head>
<body>
{{> layout/page-header}}
{{> layout/simple-header}}
\ No newline at end of file
... ...
... ... @@ -310,7 +310,7 @@
VIP:
<span class="leveldetail">\{\{vip.curVipInfo.title\}\}</span>
</h3>
\{\{#equallevelthree vip.curVipInfo.curLevel\}\}
\{\{#unless vip3 \}\}
<div class="levelinfo">
<div class="levelwrapper float-left">
<div class="levelspan">
... ... @@ -321,7 +321,7 @@
</div>
<span class="cardcate float-left">\{\{vip.nextVipInfo.title\}\}</span>
</div>
\{\{/equallevelthree\}\}
\{\{/unless\}\}
</div>
<ul class="myyoho-info-content">
<li class="item">
... ...
... ... @@ -1424,6 +1424,10 @@ function actionVipInfo(_data) {
if (typeof vipInfo === undefined || vipInfo.length < 1) {
return false;
}
if (vipInfo.vip.curVipInfo.curLevel === '3') {
vipInfo.vip3 = true;
}
$('#myYohoBox').mouseenter(function() {
$(this).addClass('acttags');
$('#myYohoBox .myyoho-info').show().html(vipInfoCombine(vipInfo));
... ...
... ... @@ -382,16 +382,16 @@
}
}
.gobuyboys {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi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kRDNzBGNjNGNSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBNDQwQTQ0QTk0RTAxMUU1QkIzQ0M2MkRDNzBGNjNGNSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PsQbj+AAAAJiSURBVHjaYrxSPf2hNq+4HAMSePHz88/D7x4KhErq/GCgEmDS4BGVQxeUYOdl52JiDWKgImA69O7Borvf3r1/+fPLT2QJHhY2X6pa5CisFK/MJSR05sPTJGQJIVZOU2paxAJjfPv3e833v7+XcDKzMoKDj4NXbuOLazaUWvCP4f+XQAntC4z/O9bBBW9+efNSnUdEjIHK4PSHJ6eYkAXe/Pp6hoEGwIhf2gzFog9/fqynhUVf//76h2LRN2Ac/fz3h+oWPf7+4QmKRaAM+vj7x7fUtujNr29HmdAFX/36eoHaFn3683MVhkUffn9fR01Lvvz59e/Hvz+bmDAj7vei3///US9+fnx4AYySfxgWAQW/PPn+8QMV4+cUuAjCJgksvS9Sy6KPv3+swGkRUHILNSwBZpf/3//9WYvTos9/fy34S4V4AmaV18Co+IPTIqDkG6CiT5Ra9PrX11PwagKXImD9dJlSi4BZZSVBi579/JTz6ueXX+RacvnTi3s+4hpLMOojdACqQ4AU+7rnV+VJteQvw//vwOB/hbXiwwWCJLUfguhtr26mMzMySQKLk0lAQ94hq9nw4poxNzNb+Le/v7b4S2gdwmYOSsWHp+I6YyogYwxNSV9PfHgsAmshbX55I8BNVGUdOxMLIyil7np9p8RTTK0Xo81ATFDo8UkYwdiynPzcwBZSJKLFxFMBsgTEBvqYQYaDLxtr44TIjPcXmf/n/78nMPavf3/fIMv9+v/3E9kWnfrwpAlYWvwFVor/j79/tN9fQnM3UjZIv/31zRtQsD38/uHLo+8fErCZARBgABfzGasBpkfVAAAAAElFTkSuQmCC') !important;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpS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F3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsSAAALEgHS3X78AAABf0lEQVRIx73VPUvDQBjA8X+ibiI6+w1EFIogSCbBKZuLkxEXETc/gasgjg6u5+Li1gOnGtqrFlEEwXfBTZdaHXyhVtQhqaQxNrW5+EzPPc/lfnDk7gzHtjaBKRrjFBgWUr2jKUxgMqI+AAzpQurQApADzkK9UZ2QUU8c28oAh4GeEFLNpAF1ABWgxy9dAxMajKqQ6s4IVhzbygK2zi3zY8UMFfIpIACL/wXdh6ED4DkFyG2A/AO6mzrkRxrbp6IgVzNSBk6ioH2gqhHKC6k+f0BCqjegpBEqgHfXRYWrEXKbQQVNyCNw3AzaA2oaoKKQ6uNXSEj1gvdTJA23npitTEoQO61Aa8BlAmRDSPX9vhlxsx3b6m0DqQmpGu7MWCgAjgF9QE5I9Rrq9eM9/UdCqpuo7814AhzbWgWKQBbIO7bVGegNAufAFnDh2NZ42xAwF8hHgExgPA10+3kXMJsEqoTGD4G8HDP3T9A8cAs8AUtCqqtAbx3YxjvgJWA5aoEvXQ1rTnQJKpQAAAAASUVORK5CYII=') !important;
}
.searchcatelifestyle {
.searchinput {
... ... @@ -761,8 +761,8 @@
margin-left: 23px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsSAAALEgHS3X78AAABc0lEQVRIx73VvS9DURjH8W+LTYTZfyBCIhLJM0pMNotJxCJi8xdYJWI0WFkstg6mumn1pxEikXiX2Fgog5dUBUNv5fa62tJzPdNznufc80lO7jknYWbrwDjVcQz0S3rDUSSBsYh6D9DnCqlAs0AaOAn1hlxCiUpiZgPAfqC3KmkyDqgFKAAdfukSGHFgFCXdJIIVM0sBoy63zI/FZKiQiQEBmPsv6C4M7QFPMUBeFeQfUMUO+RHH9m1HQZ5j5BY4ioJ2gaJDKCPp4xsk6RXIO4SyUL7rosJzCHm1oKwj5AE4rAXtACUHUE7S+4+QpGfKP0Wz4VWSZCOTmoitRqBl4LwJZE3S1/uWqDfbzDr/gJQkVd2ZdaEAaEAXkJb0Eup1U376DyRdRX2frE+AmS0BOSAFZMysNdDrBU6BDeDMzIb/DAHTgXwQGAiMJ4B2P28DppqBCqHxfSC/rTP3V9AMcA08AvOSLgK9FWCT8gHPAwtRC3wCDWxrvGA4PUcAAAAASUVORK5CYII=);
background-repeat: no-repeat;
width: 26px;
height: 26px;
width: 30px;
height: 30px;
position: relative;
cursor: pointer;
}
... ...
... ... @@ -71,6 +71,7 @@
display: block;
width: 16px;
height: 16px;
background-position: center !important;
}
}
... ...
... ... @@ -46,6 +46,7 @@ class ClassModel
$genderArr = array('boy' => '1,3', 'girl' => '2,3', 'kids' => '1,2,3', 'lifestyle' => '1,2,3');
$oneClass = array();
$item = array();
$subitem = array();
foreach ($data['data'] as $k => $v) {
$oneClass = array('name' => ucfirst(rtrim($k, 's')), 'ca' => array());
... ...
<?php
use Action\WebAction;
use Index\HomeModel;
use Configs\WebCacheConfig;
use LibModels\Web\Home\IndexData;
use WebPlugin\Cache;
use Configs\WebCacheConfig;
use Api\Yohobuy;
use WebPlugin\Images;
use WebPlugin\Helpers;
... ... @@ -16,15 +15,26 @@ class CommonController extends WebAction
*/
public function getIndexResourceBrandAction()
{
// 首页资源品牌,采用内存存储
$type = $this->get('type');
$data = array();
if (! empty($type)) {
do {
if (!$this->isAjax()) {
break;
}
$type = $this->get('type');
if (empty($type)) {
break;
}
// 首页资源品牌,采用内存存储
$key = WebCacheConfig::KEY_WEB_INDEX_BRANDS_LIST_DATA . '_' . $type;
// array('logoBrand'=>'','moreBrand'=>'')
$data = Cache::get($key);
}
echo $this->echoJson($data);
}
while (false);
$this->echoJson($data);
}
/**
... ... @@ -36,7 +46,7 @@ class CommonController extends WebAction
*/
public function getNewArrivalAction()
{
$result = $data = array();
$result = array();
do {
/* 判断是不是AJAX请求 */
if (! $this->isAjax()) {
... ... @@ -53,23 +63,29 @@ class CommonController extends WebAction
$pageCount = (int) $this->post('pageCount', 8);
if (! in_array($channel, $channels)) {
break;
} else {
$data = HomeModel::getNewArrival($channel);
}
if($pageIndex < 0) {
$data = HomeModel::getNewArrival($channel);
if (empty($data)) {
break;
}
if ($pageIndex < 0) {
$pageIndex = 0;
}
if($pageCount < 0 || $pageCount > 50) {
if ($pageCount < 0 || $pageCount > 50) {
$pageCount = 20;
}
$result = array_slice($data, $pageIndex, $pageCount);
if (empty($result)) {
$data = array_slice($data, $pageIndex, $pageCount);
if (empty($data)) {
break;
}
$result = array(
'code' => 200,
'goods' => $result
'goods' => $data
);
$data = array();
} while (false);
$this->echoJson($result);
... ...
... ... @@ -104,7 +104,6 @@ class HotrankModel
$sort = $info['data']['category_id'];
}
}
//一周热卖
$config = array(
'sort' => $sort,
'gender' => $data['gender'],
... ... @@ -114,7 +113,7 @@ class HotrankModel
$lister = $list['hotWeek']['list'];
$lister = array_values($lister);
if ($sid == 1 && $page == 1) {
$lister = array_slice($lister, 10, 50);
$lister = array_slice($lister, 10, 50); //排除十个“人气单品”的商品
}
else {
$lister = array_slice($lister, 0, 50);
... ... @@ -149,10 +148,9 @@ class HotrankModel
public static function getSearchData($config, $page, $ajax)
{
//配置查询商品参数
$viewNum = 60;
$param = array(
'order' => 's_n_desc',
'viewNum' => $viewNum,
'viewNum' => 60,
'page' => $page,
'stocknumber' => 1,
'status' => 1,
... ... @@ -206,60 +204,59 @@ class HotrankModel
public static function getProductList($result, $page, $ajax = 0)
{
$product = array();
$url = Helpers::url('/product/pro', '', 'item');
if (empty($result) || empty($result['data']) || empty($result['data']['product_list'])) {
return $product;
}
$data = $result['data']['product_list'];
$popular = array(); //一周热卖
$hotWeek = array(); //人气单品
foreach ($data as $key => $val) {
if (empty($val['goods_list'])) {
continue;
}
$defaultGoodsId = 0;
foreach ($val['goods_list'] as $v) {
if ($v['is_default'] == 'Y') {
$defaultGoodsId = empty($v['goods_id']) ? $val['goods_list'][0]['goods_id'] : $v['goods_id'];
if (isset($result) && isset($result['data']) && isset($result['data']['product_list'])) {
$data = array(
'popular' => array(
'name' => '人气单品',
'list' => array(),
),
'hotWeek' => array(
'name' => '一周热卖',
'list' => array(),
)
);
$url = Helpers::url('/product/pro', '', 'item');
foreach ($result['data']['product_list'] as $key => $val) {
if (empty($val['goods_list'])) {
continue;
}
}
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
if ($key <= 9 && $page == 1 && $ajax == 0) {
//人气单品
$product['rank'] = $key + 1;
$product['title'] = $val['product_name'];
$product['href'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? false : $val['market_price'];
$product['sPrice'] = empty($val['sales_price']) ? false : $val['sales_price'];
if ($key <= 5) {
//6张大图
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $product;
//配置商品图片超链接路径
$defaultGoodsId = 0;
foreach ($val['goods_list'] as $v) {
if ($v['is_default'] == 'Y') {
$defaultGoodsId = empty($v['goods_id']) ? $val['goods_list'][0]['goods_id'] : $v['goods_id'];
}
}
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
if ($key <= 9 && $page == 1 && $ajax == 0) {
//人气单品
$product['rank'] = $key + 1;
$product['title'] = $val['product_name'];
$product['href'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['price'] = (int) $val['market_price'] == (int) $val['sales_price'] ? false : $val['market_price'];
$product['sPrice'] = empty($val['sales_price']) ? false : $val['sales_price'];
if ($key <= 5) {
//6张大图
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$data['popular']['list'][] = $product;
}
else {
//4张小图
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$data['popular']['list'][] = $product;
}
}
else {
//4张小图
$product['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $product;
//一周热卖
$product['name'] = $val['product_name'];
$product['url'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? false : $val['market_price'];
$product['salePrice'] = empty($val['sales_price']) ? false : $val['sales_price'];
$product['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$data['hotWeek']['list'][] = $product;
}
}
else {
//一周热卖
$product['name'] = $val['product_name'];
$product['url'] = $url . '_' . $product_id . '_' . $defaultGoodsId . '.html';
$product['marketPrice'] = (int) $val['market_price'] == (int) $val['sales_price'] ? false : $val['market_price'];
$product['salePrice'] = empty($val['sales_price']) ? false : $val['sales_price'];
$product['rank'] = '';
$product['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $product;
}
}
$popular['name'] = '人气单品';
$hotWeek = array(
'name' => '一周热卖',
'list' => $hot,
);
$data['popular'] = $popular;
$data['hotWeek'] = $hotWeek;
return $data;
}
... ...
... ... @@ -21,7 +21,7 @@ class NewModel
// 组合搜索商品url
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
$urlList['sort'] = SearchData::getClassesUrl();
// 组合搜索最新上架url
$urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']);
... ...