Authored by whb

PC重构

<?php
use Action\WebAction;
class IndexController extends WebAction
{
public function indexAction()
{
echo 'hello';
exit();
}
}
\ No newline at end of file
... ...
<?php
namespace Product;
use Plugin\Helpers;
use LibModels\Web\Product\BrandData;
use Product\SearchModel;
/**
* Description of Brands
*
* @author Administrator
*/
class BrandsModel
{
const URL_BRAND_INDEX = '/product/brands/index';
/**
* 获取品牌首页banner条
* @string $domain 品牌域名
* @int $brandId 品牌id
* @int $uid 用户id
*
* @return array 品牌banner条数据
*/
public static function getBannerByDomain($domain, $bannerId, $uid = '')
{
// 构造品牌主页url
$home = Helpers::url('', '', $domain) . self::URL_BRAND_INDEX;
// 根据品牌Id获取品牌banner图
$bannerImg = BrandData::getBrandBanner($bannerId);
if (isset($bannerImg['data'])) {
$bannerImg = Helpers::getImageUrl($bannerImg['data']['banner'], 1366, 150);
}
// 根据品牌Id获取品牌(简介)、收藏
if (isset($uid)) {
$intro = BrandData::getBrandIntro($bannerId, $uid);
}
$is_favorite = false;
$logo = false;
$shopName = false;
do {
if (! isset($intro['data'])) {
break;
}
// 获取是否收藏
if ($intro['data']['is_favorite'] == 'Y') {
$is_favorite = true;
} elseif ($intro['data']['is_favorite'] == 'N') {
$is_favorite = false;
}
// 获取品牌logo
$logo = Helpers::getImageUrl($intro['data']['brand_ico'], 80, 50);
// 获取品牌名
$shopName = $intro['data']['brand_name'];
} while (false);
// 返回banner数据
return array(
'list' => array(
'brandBanner' => array(
'bannerHeight' => '150',
'coled' => $is_favorite,
'banner' => $bannerImg
),
'shopEntry' => array(
'home' => $home,
'logo' => $logo,
'shopName' => $shopName,
'sort' => array(
array(
'href' => '',
'name' => 'T恤'
),
array(
'href' => '',
'name' => '卫衣'
)
)
)
)
);
}
/**
* 搜索品牌数据
*
* @param $condition array
* 搜索数据的条件
* @param $options array
* @return array
*/
public static function getBrandSearchData($condition, $options)
{
// 调用商品搜索接口
$data = \Product\SearchModel::getSearchData($condition, $options);
unset($data['list']['filters']['brand']);
return $data;
}
}
... ...
<?php
namespace Product;
use Configs\CacheConfig;
use Plugin\Images;
use Plugin\Cache;
use Plugin\HelperSearch;
use \LibModels\Web\Product\SearchData;
/**
* sale首页模板数据模型
*
* @name SaleModel
* @package models
* @copyright yoho.inc
* @version 1.0 (2015-12-17 13:54:56)
* @author sefon
*/
class SearchModel
{
/**
* 根据条件获取搜索数据
*
* @param $condition 搜索数据的条件
* @param $options Array([imgSize]
* => Array([0] => 235[1] => 314)[minImgSize] => Array([0] => 60[1] => 80)[gender] => 1[needPd] => Y[rowNum] => 5[viewNum] => 60)
* @author sefon 2015-12-17 16:12:18
* @return array
*/
public static function getSearchData($condition, $options)
{
// 调用接口查询商品数据
$result = SearchData::searchElasticByCondition($condition);
// 调用分类信息
$category = SearchData::getClassesData();
if (isset($category['code']) && $category['code'] === 200) {
$result['data']['filter']['group_sort'] = $category['data']['sort'];
}
// 调用折扣区间
$discount = SearchData::getDiscount();
if (isset($discount['code']) && $discount['code'] === 200) {
$result['data']['filter']['discount'] = $discount['data']['discount'];
}
// 调用最新上架
$recent = SearchData::recentShelve();
if (isset($discount['code']) && $discount['code'] === 200) {
$result['data']['filter']['recent'] = $recent['data']['recent'];
}
// 组织模板数据
if (isset($result['code']) && $result['code'] === 200) {
$res = HelperSearch::getList($result, $options);
$list = HelperSearch::getTemplateData($res, $options);
$data = array(
'productListPage' => true, //初始化js
'list' => $list
);
}
return $data;
}
}
\ No newline at end of file
... ...
<?php
use Action\AbstractAction;
use Plugin\Helpers;
class Index1Controller extends AbstractAction
{
/**
* 商品搜索
*/
public function searchAction()
{
$data = array(
'searchListPage' => true,
'search' => array(
'pathNav' => array(
array(
'href' => 'm.yohobuy.com',
'name' => '首页'
),
array(
'name' => '搜索“安德玛”共18个结果'
)
),
'filters' => array(
'checkedConditions' => array(
'conditions' => array(
array(
'href' => '',
'name' => '暗黑'
),
array(
'href' => '',
'color' => '#f00'
),
array(
'href' => '',
'name' => 'CLOT'
)
),
'clearUrl' => ''
),
'channel' => array(
array(
'href' => '/?gender=1,3',
'name' => 'BOYS'
),
array(
'href' => '/?gender=2,3',
'name' => 'GIRLS'
),
array(
'href' => '',
'name' => 'KIDS'
),
array(
'href' => '',
'name' => 'LIFESTYLE'
)
),
'sort' => array(
array(
'id' => '1',
'name' => '上衣',
'sub' => array(
array(
'href' => '',
'name' => 'T恤'
),
array(
'href' => '',
'name' => '棉袄'
),
array(
'href' => '',
'name' => '外套'
)
)
),
array(
'id' => '2',
'name' => '裤子'
),
array(
'id' => '3',
'name' => '连衣裙'
),
array(
'id' => '4',
'name' => '鞋'
)
),
'brand' => array(
'default' => array(
array(
'href' => '',
'name' => 'CLOT'
),
array(
'href' => '',
'name' => 'ABLE JEANS'
),
array(
'href' => '',
'name' => 'Eight Guys'
),
array(
'href' => '',
'name' => 'FAIRWHALE JEANS'
),
array(
'href' => '',
'name' => '鬼洗'
),
array(
'href' => '',
'name' => '金银帝国Imperial Taels'
),
array(
'href' => '',
'name' => 'F.L.Y.D'
),
array(
'href' => '',
'name' => 'Tapenade特芙娜'
),
array(
'href' => '',
'name' => 'Adidas Originals'
),
array(
'href' => '',
'name' => '鬼洗'
),
array(
'href' => '',
'name' => '金银帝国Imperial Taels'
),
array(
'href' => '',
'name' => 'F.L.Y.D'
),
array(
'href' => '',
'name' => 'Tapenade特芙娜'
),
array(
'href' => '',
'name' => 'Adidas Originals'
)
),
'brandIndex' => array(
array(
'index' => 'all',
'name' => '全部'
),
array(
'index' => '0-9',
'name' => '0 ~ 9'
),
array(
'index' => 'a',
'name' => 'A'
)
),
'brandsShow' => array(
array(
'id' => '1',
'href' => '',
'index' => '0-9',
'name' => '5cm',
'key' => '5cm'
),
array(
'id' => '2',
'href' => '',
'index' => 'k',
'name' => 'KTZ',
'key' => 'ktz'
),
array(
'id' => '3',
'href' => '',
'index' => 't',
'name' => 'Tapenade特芙娜',
'key' => 'tapenade特芙娜'
),
array(
'id' => '4',
'href' => '',
'index' => 'j',
'name' => '金银帝国Imperial Taels',
'key' => '金银帝国imperial taels'
),
array(
'id' => '5',
'href' => '',
'index' => 'a',
'name' => 'ABLE JEANS',
'key' => 'able jeans'
)
)
),
'price' => array(
array(
'href' => '',
'name' => '0-239'
),
array(
'href' => '',
'name' => '240-329'
)
),
'color' => array(
array(
'href' => '',
'name' => '黑色',
'rgb' => '#000'
),
array(
'href' => '',
'name' => '红色',
'rgb' => '#f00'
)
),
'size' => array(
array(
'href' => '',
'name' => 'S'
),
array(
'href' => '',
'name' => 'L'
)
),
'seniorChose' => array(
array(
'attr' => 'style',
'name' => '风格',
'showMulti' => true,
'sub' => array(
array(
'id' => '1',
'href' => '',
'name' => '街头'
),
array(
'id' => '2',
'href' => '',
'name' => '简约'
)
)
),
array(
'attr' => 'weather',
'name' => '适用季节',
'sub' => array(
array(
'id' => '1',
'href' => '',
'name' => '春天'
),
array(
'id' => '2',
'href' => '',
'name' => '夏天'
)
)
)
)
),
'opts' => array(
'sortType' => array(
array(
'href' => '',
'name' => '默认'
),
array(
'active' => true,
'href' => '',
'name' => '最新',
'hasSortOrient' => true,
'desc' => true
),
array(
'href' => '',
'name' => '价格',
'hasSortOrient' => true
),
array(
'href' => '',
'name' => '折扣',
'hasSortOrient' => true
)
),
'checks' => array(
array(
'name' => '新品',
'checked' => true,
'href' => ''
),
array(
'name' => '打折',
'href' => ''
),
array(
'name' => '限量',
'checked' => true,
'href' => ''
)
),
'fivePerLine' => true,
'sixPerLineHref' => '',
'countPerPage' => '120',
'pageCounts' => array(
array(
'href' => '',
'count' => 60
),
array(
'href' => '',
'count' => 100
),
array(
'href' => '',
'count' => 120
)
),
'curPage' => 1,
'pageCount' => 30,
'nextHref' => 'hello'
)
),
'goods' => array(
0 => array(
'tags' => array(
'isNew' => true,
'isYearEndPromotion' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899',
'isFew' => true
),
1 => array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899',
'showColBtn' => true
),
2 => array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
3 => array(
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
4 => array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
5 => array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
)
)
);
$this->_view->display('search', $data);
}
/**
* 商品列表
*/
public function listAction()
{
$data = array(
//'searchListPage' => true,
'productListPage' => true, //初始化js
'list' => array(
'brandBanner' => array(
'bannerHeight' => 150,
'coled' => true,
'banner' => 'http://img11.static.yhbimg.com/brandBanner/2013/01/14/14/011e5ca97c33db0e79ca0a075e7cf0ae1d.jpg'
),
'pathNav' => array(
array(
'href' => 'new.yohobuy.com/girls',
'name' => 'GRILS首页'
),
array(
'href' => '/?sort=1',
'name' => '包类/装备'
)
),
'shopEntry' => array(
'home' => 'adidas.yohobuy.com',
'logo' => 'http://img11.static.yhbimg.com/brandLogo/2013/01/16/09/01f515687de080f94243cb1aa0fedb2fe1.jpg?imageMogr2/thumbnail/80x50/extent/80x50/background/d2hpdGU=/position/center/quality/90',
'shopName' => 'adidas Originals品牌店',
'sort' => array(
array(
'href' => '',
'name' => 'T恤'
),
array(
'href' => '',
'name' => '卫衣'
)
)
),
'filters' => array(
'checkedConditions' => array(
'conditions' => array(
array(
'href' => '',
'name' => '暗黑'
),
array(
'href' => '',
'color' => '#f00'
),
array(
'href' => '',
'name' => 'CLOT'
)
),
'clearUrl' => ''
),
'channel' => array(
array(
'href' => '/?gender=1,3',
'name' => 'BOYS'
),
array(
'href' => '/?gender=2,3',
'name' => 'GIRLS'
),
array(
'href' => '',
'name' => 'KIDS'
),
array(
'href' => '',
'name' => 'LIFESTYLE'
)
),
'sort' => array(
array(
'id' => '1',
'name' => '上衣',
'sub' => array(
array(
'href' => '',
'name' => 'T恤'
),
array(
'href' => '',
'name' => '棉袄'
),
array(
'href' => '',
'name' => '外套'
)
)
),
array(
'id' => '2',
'name' => '裤子'
),
array(
'id' => '3',
'name' => '连衣裙'
),
array(
'id' => '4',
'name' => '鞋'
)
),
'brand' => array(
'default' => array(
array(
'href' => '',
'name' => 'CLOT'
),
array(
'href' => '',
'name' => 'ABLE JEANS'
),
array(
'href' => '',
'name' => 'Eight Guys'
),
array(
'href' => '',
'name' => 'FAIRWHALE JEANS'
),
array(
'href' => '',
'name' => '鬼洗'
),
array(
'href' => '',
'name' => '金银帝国Imperial Taels'
),
array(
'href' => '',
'name' => 'F.L.Y.D'
),
array(
'href' => '',
'name' => 'Tapenade特芙娜'
),
array(
'href' => '',
'name' => 'Adidas Originals'
)
),
'brandIndex' => array(
array(
'index' => 'all',
'name' => '全部'
),
array(
'index' => '0-9',
'name' => '0 ~ 9'
),
array(
'index' => 'a',
'name' => 'A'
)
),
'brandsShow' => array(
array(
'id' => '1',
'href' => '',
'index' => '0-9',
'name' => '5cm',
'key' => '5cm'
),
array(
'id' => '2',
'href' => '',
'index' => 'k',
'name' => 'KTZ',
'key' => 'ktz'
),
array(
'id' => '3',
'href' => '',
'index' => 't',
'name' => 'Tapenade特芙娜',
'key' => 'tapenade特芙娜'
),
array(
'id' => '4',
'href' => '',
'index' => 'j',
'name' => '金银帝国Imperial Taels',
'key' => '金银帝国imperial taels'
),
array(
'id' => '5',
'href' => '',
'index' => 'a',
'name' => 'ABLE JEANS',
'key' => 'able jeans'
)
)
),
'price' => array(
array(
'href' => '',
'name' => '0-239'
),
array(
'href' => '',
'name' => '240-329'
)
),
'color' => array(
array(
'href' => '',
'name' => '黑色',
'rgb' => '#000'
),
array(
'href' => '',
'name' => '红色',
'rgb' => '#f00'
)
),
'size' => array(
array(
'href' => '',
'name' => 'S'
),
array(
'href' => '',
'name' => 'L'
)
),
'seniorChose' => array(
array(
'attr' => 'style',
'name' => '风格',
'showMulti' => true,
'sub' => array(
array(
'id' => '1',
'href' => '',
'name' => '街头'
),
array(
'id' => '2',
'href' => '',
'name' => '简约'
)
)
),
array(
'attr' => 'weather',
'name' => '适用季节',
'sub' => array(
array(
'id' => '1',
'href' => '',
'name' => '春天'
),
array(
'id' => '2',
'href' => '',
'name' => '夏天'
)
)
)
)
),
'opts' => array(
'sortType' => array(
array(
'href' => '',
'name' => '默认'
),
array(
'active' => true,
'href' => '',
'name' => '最新',
'hasSortOrient' => true,
'desc' => true
),
array(
'href' => '',
'name' => '价格',
'hasSortOrient' => true
),
array(
'href' => '',
'name' => '折扣',
'hasSortOrient' => true
)
),
'checks' => array(
array(
'name' => '新品',
'checked' => true,
'href' => ''
),
array(
'name' => '打折',
'href' => ''
),
array(
'name' => '限量',
'checked' => true,
'href' => ''
)
),
'fivePerLine' => true,
'sixPerLineHref' => '',
'countPerPage' => '120',
'pageCounts' => array(
array(
'href' => '',
'count' => 60
),
array(
'href' => '',
'count' => 100
),
array(
'href' => '',
'count' => 120
)
),
'curPage' => 1,
'pageCount' => 30,
'nextHref' => 'hello'
),
'goods' => array(
array(
'tags' => array(
'isNew' => true,
'isYearEndPromotion' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899',
'isFew' => true
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899',
'showColBtn' => true
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
array(
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
),
array(
'tags' => array(
'isNew' => true,
'isReNew' => true
),
'url' => 'http://adidas.yohobuy.com/?gender=1,3',
'thumb' => 'http://img12.static.yhbimg.com/goodsimg/2015/11/22/03/02c17af44dc23aa5a62d61cb59a05380bc.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'adidas Originals FORUM 中帮拼色休闲板鞋',
'salePrice' => '899'
)
),
'allSort' => array(
'updateNum' => 145,
'list' => array(
array(
'name' => '裙装',
'num' => '10',
'childList' => array(
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
),
array(
'name' => '裙装BBB',
'num' => '10',
'childList' => array(
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '全身裙装',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
)
)
),
'advNav' => array(
'advNavTitle' => 'AAAA',
'list' => array(
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg'
),
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img12.static.yhbimg.com/brandBanner/2015/02/04/06/0216e9a4c1c1edb0c8fe6b4347cc5a8035.jpg'
)
)
),
'advPic' => array(
'advPicTitle' => false,
'list' => array(
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img02.static.yohobuy.com/cms/2015/11/10/15/02ee7970deb68390b77cbf0685f26fc5bf.jpg'
),
array(
'href' => 'http://adidas.yohobuy.com/?folder=1366',
'src' => 'http://img02.static.yohobuy.com/cms/2015/11/10/15/02ee7970deb68390b77cbf0685f26fc5bf.jpg'
)
)
),
'newSales' => array(
'updateNum' => 130,
'list' => array(
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '12月03日',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
),
'allDiscount' => array(
'updateNum' => 130,
'list' => array(
array(
'name' => '1~3折',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '4~6折',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
),
array(
'name' => '7折',
'href' => 'http://adidas.yohobuy.com/?gender=1,3',
'num' => '5'
)
)
)
)
);
$this->_view->display('list', $data);
}
/*
* 获取商品颜色
*/
public function productColorAction()
{
$data = array(
array(
'url' => 'http://item.yohobuy.com/product/pro_187471_252595/NIKEAIRMAX90ESSENTIAL537384126.html',
'src' => 'http://img12.static.yhbimg.com/goodsimg/2015/09/24/09/028738fa8afcf5031733bcdfa83e397f0f.jpg?imageMogr2/thumbnail/75x100/extent/75x100/background/d2hpdGU=/position/center/quality/90'
),
array(
'url' => 'http://item.yohobuy.com/product/pro_187471_252595/NIKEAIRMAX90ESSENTIAL537384126.html',
'src' => 'http://img12.static.yhbimg.com/goodsimg/2015/09/24/09/028738fa8afcf5031733bcdfa83e397f0f.jpg?imageMogr2/thumbnail/75x100/extent/75x100/background/d2hpdGU=/position/center/quality/90'
),
);
$this->echoJson($data);
}
/*
* 热销排行
*/
public function hotrankAction() {
$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'
),
)
)
)
)
);
$this->_view->display('hotrank', $data);
}
/*
* 热销排行热门品牌ajax
*/
public function getBrandAction()
{
$data = array(
'logoBrand' => array(
array(
'href' => 'http://www.yohobuy.com',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2014/09/25/17/0248182b151d2d59cbeea8e73495d1607a.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/04/10/16/02963cdc1aeab10959bfeccc400aaa8de8.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/04/10/16/02963cdc1aeab10959bfeccc400aaa8de8.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
),
array(
'href' => '',
'img' => 'http://img12.static.yhbimg.com/brandLogo/2015/03/18/16/020d4fec29ade8ccb6bc8e23b02c958a9d.jpg?imageView/2/w/185/h/86'
)
)
);
$this->echoJson($data);
}
}
\ No newline at end of file
... ...
<?php
use Action\WebAction;
class ListController extends WebAction
{
public function indexAction()
{
}
/**
* list列表sale
*/
public function saleAction()
{
/* 过滤请求参数 */
$condition = filter_input_array(INPUT_GET, array(
//'query' => FILTER_SANITIZE_STRING,
'brand' => FILTER_VALIDATE_INT,
'sort' => FILTER_VALIDATE_INT,
'msort' => FILTER_VALIDATE_INT,
'misort' => FILTER_VALIDATE_INT,
'color' => FILTER_VALIDATE_INT,
'size' => FILTER_DEFAULT,
'style' => FILTER_DEFAULT,
'price' => FILTER_DEFAULT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,
'shelve_time' => FILTER_DEFAULT,
'isNew' => FILTER_DEFAULT,
'specialoffer' => FILTER_DEFAULT,
'limited' => FILTER_DEFAULT,
'order' => FILTER_DEFAULT,
'viewNum' => FILTER_VALIDATE_INT,
'rowNum' => FILTER_VALIDATE_INT,
'page' => FILTER_VALIDATE_INT), false);
//字符转码
foreach($condition as $key => $val){
$condition[$key] = rawurldecode($val);
}
//性別(频道)
$gender_cookie = !isset($_COOKIE['_Gender']) ? '3' : ($_COOKIE['_Gender']=='2,3' ? 2 : 1);
$gender = $this->get('gender') ? ($this->get('gender') == '2,3' ? 2 : 1) : $gender_cookie ;
$condition['gender'] = $gender;
//每页显示商品数
if(!isset($condition['viewNum']) || empty($condition['viewNum'])){
$condition['viewNum'] =60;
}
$view_num_arr = array(60, 100, 200);
if (!in_array($condition['viewNum'], $view_num_arr)) {
$condition['viewNum'] = 60;
}
//每行显示的商品数量
if(!isset($condition['rowNum']) || empty($condition['rowNum'])){
$condition['rowNum'] =5;
}
if ($condition['rowNum'] == 6) {
$imgSize = array(195, 260);
$minImgSize = array(50, 67);
} else {
$condition['rowNum'] = 5;
$imgSize = array(235, 314);
$minImgSize = array(60, 80);
}
//搜索词
//$query = $this->get('query');
//返回搜索条件
$condition['needFilter'] = 1;
$options = array(
'imgSize' => $imgSize,
'minImgSize' => $minImgSize,
'gender' => $gender,
'needPd' => 'Y',
'rowNum' =>$condition['rowNum'],
'viewNum' =>$condition['viewNum'],
);
$params = $condition + $_GET;
$params = array_filter($params);
$data = Product\SearchModel::getSearchData($params,$options);
$cate = array('boys','girls','kids','lifestyle');
$this->setWebNavHeader($cate[$gender-1]);
$this->_view->display('list', $data);
}
}
\ No newline at end of file
... ...
[memcached]
master.hosts=127.0.0.1:11212,127.0.0.1:11213
slave.hosts=127.0.0.1:11212,127.0.0.1:11213
session.hosts=127.0.0.1:11212,127.0.0.1:11213
[redis]
servers.hosts = 127.0.0.1:6379
\ No newline at end of file
... ...
[mysql]
charset = UTF8
persistent = FALSE
collation = utf8_unicode_ci
timeout = 3
[database]
yhb_test.username = test
yhb_test.passwd = 123456
yhb_test.write = 127.0.0.1:5511
yhb_test.read = 127.0.0.1:5511
\ No newline at end of file
... ...
;woman首页
routes.productsale.type = "rewrite"
routes.productsale.match = "/woman"
routes.productsale.route.module = Index
routes.productsale.route.controller = Girls
routes.productsale.route.action = index
... ...
; 折扣专区(SALE)
routes.productsale.type = "rewrite"
routes.productsale.match = "/sale"
routes.productsale.route.module = Product
routes.productsale.route.controller = List
routes.productsale.route.action = sale
... ...
<?php
use Yaf\Application;
define('SITE_MAIN', 'http://www.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://www.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
define('APPLICATION_PATH', dirname(__DIR__)); // 应用目录
define('ROOT_PATH', dirname(dirname(APPLICATION_PATH))); // 根目录
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'preview');
$application = new Application(APPLICATION_PATH . '/configs/application.preview.ini');
$application->bootstrap()->run();
\ No newline at end of file
... ...