Authored by 周少峰

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/web-list

... ... @@ -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(
... ...
... ... @@ -60,4 +60,8 @@ class CacheConfig
const KEY_CODE_YOHOCOIN_BANNER = 'key_code_yohocoin_banner';// 有货币banner数据
const KEY_WEB_HOME_NAVBAR_DATA = 'key_web_home_navbar_data';//web的导航数据
const KEY_WEB_HOME_CHANNEL_DATA = 'key_web_home_channel_data';//web首页频道数据[boys, girls, kids, lifestyle]
const KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA = 'key_web_home_newarrival_data';//web频道最新上架数据[boys, girls, kids, lifestyle]
}
... ...
... ... @@ -22,7 +22,7 @@ class IndexData
$params = array('parent_id'=>'','platform'=>'web',
'status'=> $status,'fields'=> $fields
);
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_OPERATIONS_CATEGORY,'getCategory', $params, false);
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_OPERATIONS_CATEGORY,'getCategory', $params, true);
}
/**
... ...
<?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) {
... ... @@ -823,4 +824,57 @@ class Process
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
... ...
... ... @@ -240,9 +240,8 @@ class HelperSearch
public static function groupSort($sort)
{
$options = self::$options;
if (isset($options['controller']) && $options['controller'] != 'Search') {
if (isset($options['controller']) && $options['controller'] == 'Search') {
return array();
}
//设置导航
... ... @@ -286,7 +285,6 @@ class HelperSearch
}
}
$result['list'] = $sortList;
// print_r($result); exit;
return $result;
}
... ... @@ -294,7 +292,7 @@ class HelperSearch
{
$result = array();
$options = self::$options;
if (!isset($options['controller']) || $options['controller'] != 'Search') {
if (!isset($options['controller']) || $options['controller'] == 'Search') {
return $result;
}
$params = self::$params;
... ...
... ... @@ -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();
});
... ...
... ... @@ -34,6 +34,20 @@
</div>
{{/if}}
{{#if gender}}
<div class="channel section">
<span class="title">性别:</span>
<div class="attr-content clearfix">
{{#each channel}}
<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
{{name}}
</a>
{{/each}}
</div>
</div>
{{/if}}
{{#if sort}}
<div class="sort section">
<span class="title">分类:</span>
... ...
... ... @@ -135,7 +135,6 @@ exports.init = function(num) {
// 鼠标悬浮获取到商品信息后显示第一张图片
if (data[0] && data[0].src) {
$(event.target).find('.good-thumb img').attr('src', data[0].src);
$goodInfoMain.find('.good-thumb img').attr('src', data[0].src);
}
... ...
... ... @@ -82,6 +82,7 @@
width: 14px;
border: 1px solid #fff;
margin-bottom: -3px;
background-size: 100% !important;
}
.clear-checked {
... ... @@ -283,6 +284,7 @@
border: 1px solid #ccc;
margin-bottom: -6px;
margin-right: 5px;
background-size: 100% !important;
}
.senior {
... ...
... ... @@ -125,9 +125,20 @@
}
}
@keyframes slideRight {
from {
max-width: 0;
}
to {
max-width: 150px;
}
}
.good-select-color {
float: left;
margin-top: 22px;
overflow: hidden;
animation: slideRight 600ms 1;
ul {
display: block;
... ...
... ... @@ -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, '/'),
);
}
... ... @@ -222,24 +224,29 @@ class DetailModel
$totalStorageNum += $colorStorageNum;
}
// 遍历所有尺码,统计出该尺码的每个颜色的库存量,没有时添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, '/');
}
// 遍历所有尺码,构建颜色显示数据
$i = 1;
foreach ($allSizeList as $sizeName => $value) {
// 默认尺码
$sizeGroup[0]['size'][] = array(
'name' => $sizeName, // 尺码名称
'sizeNum' => empty($value) ? false : true, // 是否有库存 (false:表示没有库存,true:表示有库存)
);
// 各个颜色的尺码, 每行显示一个尺码对应的颜色
foreach ($colorList as $colorArr) {
$colorArr['colorNum'] = isset($colorStorageGroup[ $colorArr['skcId'] ][$sizeName]) ? $colorStorageGroup[ $colorArr['skcId'] ][$sizeName] : 0;
$colorGroup[$i]['color'][] = $colorArr;
}
// 格式化尺码对应的各个颜色分组
foreach ($colorGroup as $value) {
$sizeGroup[]['size'] = $sizeList[$value['skcId']];
++ $i;
}
// 遍历所有颜色, 构建尺码显示数据
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,8 +621,6 @@ class DetailModel
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::upvoteConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
... ... @@ -625,11 +629,12 @@ class DetailModel
}
// 处理数据
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,8 +653,6 @@ class DetailModel
$result = array('code' => 400, 'message' => '出错啦~');
do {
$record = DetailData::usefulConsult($uid, $id);
if (empty($uid)) {
$result['code'] = 401;
$result['message'] = '用户id为空';
... ... @@ -658,11 +661,12 @@ class DetailModel
}
// 处理数据
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
{
... ...
... ... @@ -63,6 +63,9 @@ class HomeModel
return array();
}
$menu = array();
$key = sprintf('%s_%s_%s',CacheConfig::KEY_WEB_HOME_NAVBAR_DATA, md5(serialize($data)), $channel);
$menu = Cache::get($key);
if(empty($menu)) {
$item = array();
foreach ($data['data'] as $val) {
$item = array(
... ... @@ -112,6 +115,8 @@ class HomeModel
}
$menu[] = $item;
}
Cache::set($key, $menu, 3600);
}
return $menu;
}
... ... @@ -165,9 +170,14 @@ class HomeModel
*/
public static function getChannelResource($channel, $content_code)
{
$key = sprintf(CacheConfig::KEY_WEB_HOME_CHANNEL_DATA.'_'.$channel);
$data = Cache::get($key);
if(empty($data)) {
$resource = IndexData::getResourceData($content_code);
// 格式化数据
$data = ChannelProcess::getFormat($channel, $resource['data']);
Cache::set($key, $data, 3600);
}
return $data;
}
... ... @@ -213,6 +223,10 @@ class HomeModel
public static function getNewArrival($channel)
{
$result = array();
$key = sprintf(CacheConfig::KEY_WEB_HOME_CHANNEL_NEWARRIVAL_DATA.'_'.$channel);
//缓存数据
$result = Cache::get($key);
if(empty($result)) {
$params = array(
'order' => 's_t_desc',
'shelve_time' => strtotime("-60 days") . ',' . time()
... ... @@ -253,6 +267,8 @@ class HomeModel
}
}
}
Cache::set($key, $result, 3600);
}
return $result;
}
}
\ No newline at end of file
... ...
<?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
... ...
... ... @@ -53,7 +53,6 @@ class BackController extends WebAction {
if (Helpers::verifyEmail($phoneNum)) { // 验证邮箱
$email = $phoneNum;
$data = BackData::sendCodeToEmail($email);
if ($data ['code'] == 200) {
$this->setSession('email', $email);
$this->redirect ('sendemail');
... ... @@ -64,7 +63,8 @@ class BackController extends WebAction {
} else if (Helpers::verifyMobile($phoneNum)) { // 验证手机号
$mobile = $phoneNum;
$data = BackData::sendCodeToMobile($mobile, $area);
if ($data ['code'] == 200) {
if ($data['code'] == 200) {
$this->setSession ('mobile', $mobile );
$this->setSession ('area', $area );
$this->setSession ('verifyCode', $verifyCode );
... ... @@ -208,6 +208,8 @@ class BackController extends WebAction {
$this->redirect ( SITE_MAIN . $url );
}
}
//出错直接跳到找回密码页
$this->redirect ('/passport/back/index');
}
/**
... ... @@ -224,4 +226,5 @@ class BackController extends WebAction {
}
return $info;
}
}
\ 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
... ...
... ... @@ -8,8 +8,26 @@ class ListController extends WebAction
}
/**
* list列表new(模板new-sale)
*/
public function newAction(){
$condition = array(
'order' => 's_t_desc'
);
$options = array(
'specialsale_id' => 'Y',
'needDay' => 'Y'
);
$newData = Product\NewModel::getNewSearchData($condition, $options);
$data = array(
'productListPage' => true,
'newSale' => $newData
);
$this->setWebNavHeader();
//渲染模板
$this->_view->display('new-sale', $data);
}
/**
... ...
<?php
use Action\WebAction;
/**
* new页
*
*/
class NewController extends WebAction
{
public function indexAction()
{
$condition = array(
'order' => 's_t_desc'
);
$options = array(
'specialsale_id' => 'Y',
'needDay' => 'Y'
);
$newData = Product\NewModel::getNewSearchData($condition, $options);
$data = array(
'productListPage' => true,
'newSale' => $newData
);
$this->setWebNavHeader();
//渲染模板
$this->_view->display('new-sale', $data);
}
}