Authored by whb

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

... ... @@ -44,4 +44,14 @@ class FavoriteData {
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'delUidProductFav', array($uid, $productSkn));
}
/**
* 根据uid和商品的skn添加或取消收藏品牌
* @param $uid
* @param $productSkn
* @return bool
*/
public static function changeFavoriteBrand($uid, $productSkn)
{
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . self::URL_PRODUCT_FAVORITE, 'toggleBrandFav', array($uid, $productSkn));
}
}
... ...
... ... @@ -208,7 +208,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
// isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -428,9 +428,9 @@ class FloorProcess
{
// URL附加参数
$param = '';
if (isset(self::$channel[$type])) {
/*if (isset(self::$channel[$type])) {
$param = '/?gender=' . self::$channel[$type];
}
}*/
$result = array();
$result['hotBrandsScroll']['name'] = $data['title']['title'];
... ...
... ... @@ -95,7 +95,7 @@ class HelperSearch
$result['leftContent'][]['newSales'] = self::recentShelve($data['recent']['recent']);
}
//品牌banner
$result['brandBanner'] = isset($data['brand']) ? self::getBannerFormat($data['brand'], $options['brandBanner']) : array();
$result['brandBanner'] = isset($data['brand']) && !empty($data['brand']) ? self::getBannerFormat($data['brand'], $options['brandBanner']) : array();
//总记录数
if (isset($data['product']['total'])) {
$result['totalCount'] = $data['product']['total'];
... ...
<?php
use Action\WebAction;
use LibModels\Web\Product\BrandData;
use LibModels\Web\Product\FavoriteData;
use \LibModels\Web\Product\HotrankData;
use product\HotrankModel;
... ... @@ -50,6 +51,7 @@ class IndexController extends WebAction
//调用模型获得数据
$data = Product\BrandsModel::getBrandSearchData($condition, $options);
$data = array(
//初始化js
'searchListPage' => true,
... ... @@ -106,6 +108,22 @@ class IndexController extends WebAction
//渲染模板
$this->_view->display('list',$data);
}
//收藏品牌
public function favoriteBrandAction($uid = '', $brandId = '')
{
if (!$this->isAjax()) {
return;
}
if ($uid && $brandId) {
//调用接口收藏或取消收藏
$result = FavoriteData::changeFavoriteBrand($uid, $brandId);
if (isset($result['code']) && $result['code'] == 200) {
$this ->echoJson($result['message']);
}
}
}
/**
* 热销排行
*/
... ...