Authored by 毕凯

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

... ... @@ -465,14 +465,14 @@ class WebAction extends Controller_Abstract
*/
protected function setWebNavHeader($channel = '')
{
if(empty($channel)) {
$channel = \Index\HomeModel::getSwitchChannel();
}
else {//设置频道
\Index\HomeModel::setSwitchToCookie($channel);
}
// if(empty($channel)) {
// $channel = \Index\HomeModel::getSwitchChannel();
// }
// else {//设置频道
// \Index\HomeModel::setSwitchToCookie($channel);
// }
$header = array(
'navbars'=>\Index\HomeModel::getNavBars($channel),
'navbars'=> \Index\HomeModel::getNavBars($channel),
'gobytype'=> 'gobuy'.$channel,
'searchcate'=>'searchcate'.$channel,
'myyoho' => array(
... ...
<?php
namespace LibModels\Web\Product;
use Api\Yohobuy;
use Api\Sign;
/**
* 热销排行
*
* */
class HotrankData extends \LibModels\Wap\Product\SearchData
{
const URI_HOTRANK_RES = '/operations/service/v4/resource';
const URI_HOTRANK_TAG = '/operations/api/v5/resource/get';
/**
获取热销排行
* 分类标签
*/
public static function getHotranktag($client_type = 'web',$channel = 0, $is_concurrent = true, $callback = '')
{
// 构建必传参数
$params = Yohobuy::param();
$params['client_type'] = 'web';
$params['channel'] =$channel ;
$params['is_concurrent'] = true;
$params['callback'] = $callback;
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_HOTRANK_TAG, $params);
}
}
\ No newline at end of file
... ...
... ... @@ -263,7 +263,8 @@ class Process
'mergeNewReportData',
'mergeSinglehotData2',
'mergeHotCategoryData',
'mergeGirlkidsData'
'mergeGirlkidsData',
'mergeHotBrandsData'
);
foreach ($data as $key => $val) {
foreach ($mergeProcessList as $merge) {
... ... @@ -807,7 +808,7 @@ class Process
// 排序
uksort($result, function ($a, $b) use($skns) {
$skn_arr = explode(' ', $skns);
return array_search($a, $skn_arr) > array_search($b, $skn_arr);
return array_search($a, $skn_arr) > array_search($b, $skn_arr);
});
$pos = 1;
//添加TOP标示
... ... @@ -819,8 +820,61 @@ class Process
break;
}
$pos ++;
}
return $result;
}
}
return $result;
}
/**
* 热门品牌数据处理
*
* @param array $data
* @param string $type
*/
public static function mergeHotBrandsData($key,array &$data,$type)
{
$result = array();
$temp = array();
if ($data[$key]['template_name'] == 'custom_brands')
{
// print_r($data[$key]);
$result = array(
'hotBrands' => array(
'name' => '',
'brandUrl' => ''
)
);
// text模版
$result['hotBrands']['name'] = '热门品牌';
//floor模板
$floor = array(
'logoBrand' => '',
'moreBrand' => ''
);
$brands = $data[$key]['data']['list'];
foreach ($brands as $val)
{
$width = 185;
$height = 86;
$type = 'lifestyle';
$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';
//$floor['moreBrand'] = 'http://yohobuy.com/brands?gender=1,3&openby:yohobuy={"action":"go.list","params":{"actiontype":0,"gender":"1,3"}}';
//print_r($floor);
$type_key = sprintf("%s_%s", $type, $key);
$cacheKey = sprintf("%s_%s", CacheConfig::KEY_INDEX_BRANDS_LIST_DATA, $type_key);
//print_r($cacheKey);
Cache::set($cacheKey, $floor, 7200);
$result['hotBrands']['brandUrl'] = '/common/getIndexResourceBrand?type=' . $type_key;
//print_r($result['hotBrands']['brandUrl']);
}
return $result;
}
}
\ No newline at end of file
... ...
... ... @@ -88,7 +88,6 @@ $invoice.on('touchend', '.checkbox', function() {
if ($this.hasClass('icon-checkbox')) {
$invoice.removeClass('focus');
}
return false;
});
function orderCompute() {
... ... @@ -243,10 +242,10 @@ $('.coin').on('touchend', function() {
orderCompute();
});
$invoice.on('touchend', function(e) {
$invoice.on('touchend', '.checkbox', function(e) {
var $this = $(this);
orderInfo('invoice', $this.find('.checkbox').hasClass('icon-cb-checked'));
orderInfo('invoice', $this.hasClass('icon-cb-checked'));
e.preventDefault();
e.stopPropagation();
});
... ...
... ... @@ -167,15 +167,15 @@ class DetailModel
$colorGroup = array();
$sizeGroup = array();
$goodsGroup = array();
$colorList = array();
$sizeList = array();
$allSizeList = array(); // 所有尺码列表
$thumbImageList = array();
$colorStorageGroup = array(); // 颜色分组的库存总数集合, 多个之间用/分隔
$sizeStorageStr = ''; // 尺码库存总数集合, 多个之间用/分隔
$colorStorageNum = 0;
$totalStorageNum = 0; // 总库存数
foreach ($baseInfo['goodsList'] as $value) {
$colorStorageNum = 0;
$sizeStorageStr = '';
// 商品分组
if (isset($value['goodsImagesList'])) {
... ... @@ -188,10 +188,10 @@ class DetailModel
}
// 商品的尺码列表
$colorStorageGroup[$value['productSkc']] = array();
$colorStorageGroup[ $value['productSkc'] ] = array();
if (isset($value['goodsSizeBoList'])) {
foreach ($value['goodsSizeBoList'] as $size) {
$sizeList[$value['productSkc']][] = array(
$sizeList[ $value['productSkc'] ][] = array(
'id' => $size['id'],
'skuId' => $size['goodsSizeSkuId'],
'goodsId' => $size['goodsId'],
... ... @@ -199,19 +199,21 @@ class DetailModel
'name' => $size['sizeName'],
'sizeNum' => $size['goodsSizeStorageNum'],
);
// 所有尺码列表,赋值用于前端展示默认尺码的时候 判断出没有库存则显示灰色
$allSizeList[ $size['sizeName'] ] = empty($allSizeList[ $size['sizeName'] ]) ? $size['goodsSizeStorageNum'] : $allSizeList[ $size['sizeName'] ];
$colorStorageNum += intval($size['goodsSizeStorageNum']);
$sizeStorageStr .= $size['goodsSizeStorageNum'] . '/';
$colorStorageGroup[$value['productSkc']][$size['sizeName']] = $size['goodsSizeStorageNum'];
}
// 颜色分组
$colorGroup[] = array(
$colorList[] = array(
'id' => $value['colorId'],
'skcId' => $value['productSkc'],
'name' => $value['colorName'],
'goodsName' => $value['goodsName'],
'colorNum' => $colorStorageNum,
'sizeNumStr' => rtrim($sizeStorageStr, '/'),
);
}
... ... @@ -221,25 +223,30 @@ class DetailModel
// 商品库存总数
$totalStorageNum += $colorStorageNum;
}
// 遍历所有尺码,构建颜色显示数据
$i = 1;
foreach ($allSizeList as $sizeName => $value) {
// 默认尺码
$sizeGroup[0]['size'][] = array(
'name' => $sizeName, // 尺码名称
'sizeNum' => empty($value) ? false : true, // 是否有库存 (false:表示没有库存,true:表示有库存)
);
// 遍历所有尺码,统计出该尺码的每个颜色的库存量,没有时添0,不能空着,因为JS中需要判断
foreach ($sizeList as $skc => $sizeArr) {
foreach ($sizeArr as $key => $value) {
$sizeStorageStr = '';
foreach ($colorStorageGroup as $colorArr) {
if (isset($colorArr[$value['name']])) {
$sizeStorageStr .= $colorArr[$value['name']] . '/';
} else {
$sizeStorageStr .= '0/';
}
}
$sizeList[$skc][$key]['colorNumStr'] = rtrim($sizeStorageStr, '/');
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
foreach ($colorList as $colorArr) {
$colorArr['colorNum'] = isset($colorStorageGroup[ $colorArr['skcId'] ][$sizeName]) ? $colorStorageGroup[ $colorArr['skcId'] ][$sizeName] : 0;
$colorGroup[$i]['color'][] = $colorArr;
}
++ $i;
}
// 格式化尺码对应的各个颜色分组
foreach ($colorGroup as $value) {
$sizeGroup[]['size'] = $sizeList[$value['skcId']];
// 遍历所有颜色, 构建尺码显示数据
foreach ($colorList as $value) {
// 各个尺码的颜色,每行显示一个颜色的对应尺码
$sizeGroup[]['size'] = $sizeList[ $value['skcId'] ];
// 默认颜色
$colorGroup[0]['color'][] = $value;
}
// 商品图: 多个
... ... @@ -563,9 +570,8 @@ class DetailModel
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$consultList = DetailData::consultList($uid, $productId, $pageNum, $pageSize);
if (isset($consultList['code']) && $consultList['code'] === 200) {
$consultList = $consultList['data']['list'];
$build = array();
foreach ($consultList as $value) {
foreach ($consultList['data']['list'] as $value) {
$build['question'] = $value['ask'];
$build['time'] = $value['ask_time'];
$build['answer'] = $value['answer'];
... ... @@ -615,21 +621,20 @@ class DetailModel
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::upvoteConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
$result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $total))));
break;
}
// 处理数据
if ($record && isset($record['code'])) {
$record = DetailData::upvoteConsult($uid, $id);
if (!empty($record['code'])) {
$result['code'] = $record['code'];
$result['message'] = $record['message'];
}
}while(false);
} while (false);
return $result;
}
... ... @@ -648,21 +653,20 @@ class DetailModel
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::usefulConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
$result['data'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $total))));
break;
}
// 处理数据
if ($record && isset($record['code'])) {
$record = DetailData::usefulConsult($uid, $id);
if (!empty($record['code'])) {
$result['code'] = $record['code'];
$result['message'] = $record['message'];
}
}while(false);
} while (false);
return $result;
}
... ...
<?php
use Action\WebAction;
/**
* 默认控制器
*/
use Action\WebAction;
class IndexController extends WebAction
{
... ...
... ... @@ -115,7 +115,7 @@ class HomeModel
return $menu;
}
/**
/**
* 选择频道
*
* @return void
... ...
<?php
namespace product;
use Plugin\Images;
use Plugin\Helpers;
use Plugin\Cache;
use Configs\CacheConfig;
use LibModels\Web\Home\IndexData;
use \LibModels\Web\Product\HotrankData;
use \LibModels\Web\Product\SearchData;
class HotrankModel {
/**
* 人气单品 一周热卖
*/
static public function getSearchData($condition, $options)
{
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($condition);
//print_r($result);
if(!empty($result)){
$res = self::getProductList($result);
if(!empty($res['popular'])){
$data['popular'] = $res['popular'];
}
if(!empty($res['hotWeek'])){
$data['hotWeek'] = $res['hotWeek'];
}
}
return $data;
}
/**
* 获取分类标签
*/
static public function getHotranktag($classes)
{
$list = SearchData::getClassesData($classes);
//print_r($list);
$nav = array();
if(!empty($list['data']['sort'])){
foreach($list['data']['sort'] as $li=>$lt){
$nav[$li]['sid'] = $lt['sort_id'];
$nav[$li]['textCn'] = $lt['sort_name'];
}
}
//print_r($nav);
return $nav;
}
/**
* 人气单品 一周热卖 数据处理
*/
static public function getProductList($result)
{
/*----product start---------*/
if(empty($result) || empty($result['data']) || empty($result['data']['product_list'])){
return;
}
$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 = $v['goods_id'];
}
}
if(empty($defaultGoodsId)){
$defaultGoodsId = $val['goods_list'][0]['goods_id'];
}
$product_id = empty($val['product_id']) ? '' : $val['product_id'];
$re['url'] = 'http://item.yohobuy.com/product/pro_'.$product_id.'_'.$defaultGoodsId.'.html';
$re['marketPrice'] = (int)$val['market_price'] == (int)$val['sales_price'] ? '' : '¥'.$val['market_price'];
$re['salePrice'] = empty($val['sales_price']) ? '' : '¥'.$val['sales_price'];
$re['name'] = $val['product_name'];
if($key <= 9){
$re['rank'] = $key + 1;
if($key <= 5){
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 378, 504, 2);
$popular['list'][] = $re;
}else{
$re['img'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$popular['list'][] = $re;
}
}else{
$re['rank'] = '';
$re['thumb'] = empty($val['default_images']) ? '' : Images::getImageUrl($val['default_images'], 280, 373, 2);
$hot[] = $re;
}
}
$popular['name'] = '人气单品';
$hotWeek = array(
'name'=>'一周热卖',
'list'=>$hot,
);
return array('popular'=>$popular,'hotWeek'=>$hotWeek);
}
}
\ No newline at end of file
... ...
... ... @@ -2,6 +2,10 @@
use Action\WebAction;
use LibModels\Web\Product\BrandData;
use LibModels\Web\Product\HotrankData;
use product\HotrankModel;
use LibModels\Web\Home\IndexData;
class IndexController extends WebAction
{
/**
... ... @@ -47,5 +51,240 @@ class IndexController extends WebAction
//渲染模板
$this->_view->display('list',$data);
}
public function hotrankAction() {
$this->setWebNavHeader(\Index\HomeModel::COOKIE_NAME_LIFESTYLE);
$data = array(
'hotrankPage' => true,
'hotrank' => array(
array(
'slide' => array(
'list' => array(
array(
'href' => '/?gender=1,3',
'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img10.static.yhbimg.com/taobaocms/2015/11/26/12/01c3b99f554ad50d9e5a9900719715c94c.jpg'
),
array(
'href' => '/?gender=1,3',
'img' => 'http://img12.static.yhbimg.com/taobaocms/2015/11/27/09/02a4f1c10e1e81574520e5c0239741a076.jpg'
)
)
)
),
array(
'popular' => array(
'name' => '人气单品',
'list' => array(
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '1'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '2'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '3'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '4'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '5'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '6'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '7'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '8'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '9'
),
array(
'href' => '',
'img' => 'http://img13.static.yhbimg.com/goodsimg/2014/09/16/07/027e03e45e3e88db0adbf6255671546a0b.jpg?imageMogr2/thumbnail/378x504/extent/378x504/background/d2hpdGU=/position/center/quality/90',
'title' => 'YYYOHOOD 黄伟文Wyman X yohood联名商品 圆领卫衣',
'price' => '399',
'sPrice' => '199',
'rank' => '10'
)
)
)
),
array(
'hotBrands' => array(
'name' => '热门品牌',
)
),
array(
'hotWeek' => array(
'name' => '一周热卖',
'nav' => array(
array(
'textCn' => 'TOP100',
'url' => '',
'sid' => 1
),
array(
'textCn' => '上装',
'url' => '',
'sid' => 2
),
array(
'textCn' => '男生测试',
'url' => '',
'sid' => 3
),
array(
'textCn' => '配饰',
'url' => '',
'sid' => 4
)
),
'list' => array(
array(
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',
'name' => 'MARtube马克图布 暖手宝移动电源萌兔',
'marketPrice' => '109',
'salePrice' => '129'
),
array(
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',
'name' => 'MARtube马克图布 暖手宝移动电源萌兔',
'marketPrice' => '109',
'salePrice' => '129'
),
array(
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',
'name' => 'MARtube马克图布 暖手宝移动电源萌兔',
'marketPrice' => '109',
'salePrice' => '129'
),
array(
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',
'name' => 'MARtube马克图布 暖手宝移动电源萌兔',
'marketPrice' => '109',
'salePrice' => '129'
),
array(
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',
'name' => 'MARtube马克图布 暖手宝移动电源萌兔',
'marketPrice' => '109',
'salePrice' => '129'
),
array(
'thumb' => 'http://img13.static.yhbimg.com/goodsimg/2015/11/24/10/020dce58a189f3fbfc071b3d5dc7ccc4e9.jpg?imageMogr2/thumbnail/280x373/extent/280x373/background/d2hpdGU=/position/center/quality/90',
'url' => 'http://item.yohobuy.com/product/pro_294497_377385.html',
'name' => 'MARtube马克图布 暖手宝移动电源萌兔',
'marketPrice' => '109',
'salePrice' => '129'
),
)
)
)
)
);
$data = array( 'hotrankPage' => true,
'footerTop'=> true,
'hotrank' => array()
);
//焦点图 热门品牌
$focus = \Index\HomeModel::getChannelResource('lifestyle', 'd131aba83a84a6977eee3a7403a713de');
//print_r($focus);
$data['hotrank']['slide'] = $focus[0]['slide'];
$data['hotrank']['hotBrands'] = $focus[1]['hotBrands'];
//人气单品 一周热卖
$page = 1;
$param = array('order'=>'s_n_desc','viewNum'=>60,'page'=>1,'stocknumber'=>1,'status'=>1,'gender'=>'','attribute_not'=>2);
$publiclist = \product\HotrankModel::getSearchData($param,$page);
$data['hotrank']['popular'] = $publiclist['popular'];
$data['hotrank']['hotWeek'] = $publiclist['hotWeek'];
//print_r($publiclist);
//分类标签
$classes = array('gender' => 2);
$nav = \product\HotrankModel::getHotranktag($classes);
$data['hotrank']['hotWeek']['nav'] = $nav;
//print_r($data);
$this->_view->display('hotrank', $data);
}
}
?>
\ No newline at end of file
... ...