Authored by rqq

Merge branch 'release/4.4' of http://git.dev.yoho.cn/web/yohobuywap into release/4.4

... ... @@ -124,26 +124,7 @@ class ListData
$param['method'] = 'app.shop.getSortInfo';
$param['shop_id'] = $shopId;
$param['client_secret'] = Sign::getSign($param);
//TODO
return Yohobuy::get(Yohobuy::API_URL, $param);
// return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
/**
* 根据brandid获取相关店铺
* @param int $brandId
* @author sefon 2016-4-28 13:41:09
* @return array
*/
public static function getShopByBrandId($brandId, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shop.queryShopByBrandId';
$param['brand_id'] = $brandId;
$param['client_secret'] = Sign::getSign($param);
//TODO
return Yohobuy::get(Yohobuy::API_URL, $param);
// return Yohobuy::get('http://192.168.102.218:8080/gateway/', $param, $cache);
}
}
... ...
... ... @@ -148,4 +148,18 @@ class ShopData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 根据brandid获取相关店铺
* @param int $brandId
* @author sefon 2016-4-28 13:41:09
* @return array
*/
public static function getShopByBrandId($brandId, $cache = 600)
{
$param = Yohobuy::param();
$param['method'] = 'app.shop.queryShopsByBrandId';
$param['brand_id'] = $brandId;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
\ No newline at end of file
... ...
... ... @@ -431,10 +431,18 @@ class ListModel
* @author sefon 2016-4-28 13:38:23
* @return array
*/
public static function brandShop($brandId)
public static function getBrandShops($brandId)
{
$brandShop = ListData::getShopByBrandId($brandId);
// print_r($brandShop); exit;
$result = array();
$brandShop = ShopData::getShopByBrandId(1559);
if (isset($brandShop['code']) && $brandShop['code'] && !empty($brandShop['data'])) {
foreach ($brandShop['data'] as $key => $val) {
$result[$key]['url'] = Helpers::url('/product/index/brand/', array('shop_id', $val['shop_id']));
$result[$key]['thumb'] = $val['brand_ico'];
$result[$key]['name'] = $val['brand_name'];
}
}
return $result;
}
/**
... ...
... ... @@ -133,6 +133,7 @@ class IndexController extends AbstractAction
}
/* 品牌域名参数 @see Bootstrap.php */
$domain = $this->param('named');
// $domain = 'andybrier';
if (empty($domain)) {
$this->go(SITE_MAIN);
}
... ... @@ -141,8 +142,7 @@ class IndexController extends AbstractAction
// 存标题信息
$title = '';
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
//TODO 无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
//TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
//无店铺:0--->品牌页 无单品店有多品店:1--->搜索页 有单品店:2--->店铺页面
// $brandLogo['shopId'] = 672;
// $brandLogo['type'] = 2;
if ($brandLogo['type'] == 2 && !empty($brandLogo['shopId'])) {
... ... @@ -153,7 +153,11 @@ class IndexController extends AbstractAction
if ($brandLogo && isset($brandLogo['id'])) {
$brandId = $brandLogo['id'];
}
//获取品牌店铺信息
$brandShop = $this->brandShop($brandId);
if (!empty($brandShop)) {
$brandLogo = $brandShop;
}
/* 搜索框相关 */
$from = $this->get('from');
$query = $this->get('query');
... ... @@ -542,294 +546,18 @@ class IndexController extends AbstractAction
} while(false);
$this->echoJson($data);
}
/**
* 店铺品牌首页
*
* @return mixed
* 根据brandId 获取相关店铺列表
* @param int $brandId
* @author sefon 2016-4-28 13:38:23
* @return array
*/
public function testAction()
public static function brandShop($brandId)
{
$data = array(
'shopId' => '104',
'appVersion' => '123',
'branerImg' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026e96d1b403d28407650c7228bb4ca405.jpg?imageView2/2/w/640/h/200',
'logoImg' => '',
'storeName' => 'Vans专营店',
'collect' => false,
'alreadyCollect' => 'product/collect.png',
'notCollect' => '',
'allGoods' => '',
'goodList' => 'http://www.baidu.com',
'brandList' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re34456556900'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/18/05/026b9aee5b7d2ec33e8db877c3d87b3386.jpg?imageView2/2/w/640/h/403',
'brandName' => '123re344565'
)
),
'url' => ''
),
'bannerTop' => array(
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
),
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/01/19/11/02039485d87cc1b100b883244cf386e62d.jpg?imageView/2/w/640/h/200',
),
)
),
'spring' => array(
array(
'url' => '',
'springType' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/01ea96f5fd2ea8ef99d37d00f39d8e57f0.jpg?imageView/2/w/275/h/160'
),
array(
'url' => '',
'springType' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160'
)
),
'hotCategory' => array(
'name' => '热门品类',
'list' => array(
array(
'url' => '',
'img' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/27/03/02727a01918939223937019a3f9114ee19.jpg?imageView/2/w/140/h/140',
),
array(
'url' => 'http://img12.static.yhbimg.com/yhb-img01/2016/04/27/03/02727a01918939223937019a3f9114ee19.jpg?imageView/2/w/140/h/140',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
),
array(
'url' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
'img' => 'http://img11.static.yhbimg.com/yhb-img01/2015/12/29/08/019c44dcf0a93e9f3afe2fbec0d1961046.jpg?imageView/2/w/275/h/160',
)
)
),
'hotList' => array(
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599.00',
'presentPrice' => '¥399.00'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599.00',
'presentPrice' => '¥399.00'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
),
array(
'url' => '',
'listUrl' => 'http://img11.static.yhbimg.com/goodsimg/2016/04/07/07/0147c904336407bb9f4008bfda7920b9bd.jpg?imageMogr2/thumbnail/276x366/extent/276x366/background/d2hpdGU=/position/center/quality/80',
'productName' => 'Vans专营店',
'originalPrice' => '¥599',
'presentPrice' => '¥399'
)
),
'goods' => array(
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => false,
'is_advance' => true,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
),
array(
'url' => 'http://m.yohobuy.com/product/pro_320421_412063/SYSTAGYuanLingWeiYiSYSA601HC09.html',
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/12/07/09/01ced0e2ed6a4f2a6d95be70cd0a6c5a56.jpg?imageView/2/w/235/h/314',
'name' => 'NEFF ONE OF US RAGLAN L/S 男款森林风连帽卫衣',
'salePrice' => '759.00',
'price' => '799.00',
'tags' => array(
'is_new' => true,
'is_advance' => false,
'is_discount' => false,
'is_yohoood' => false,
'is_limited' => false
),
'is_soon_sold_out' => false
)
),
'filter' => array(
'classify' => array(
array(
'default' => true,
'title' => 'aaa',
'name' => 'name',
'dataType' => '1',
'subs' => array(
'chosed' => true,
'dataId' => '1',
'name' => 'bbb',
)
)
)
)
);
return $this->_view->display('shop', array(
'shopIndex' => $data,
'shopPage' => true
));
//TODO 1559
return ListModel::getBrandShops($brandId);
}
}
... ...