Authored by 周少峰

shop index brand list

... ... @@ -103,6 +103,11 @@ class ShopProcess
*/
private static function brandBrowse($data)
{
$brandNumber = count($data);
//少于2个不展示
if ($brandNumber < 2) {
return;
}
foreach ($data as $val) {
self::$shopData['brandList']['list'][] = array(
'url' => Helpers::url('', '', $val['brandDomain']),
... ... @@ -110,7 +115,8 @@ class ShopProcess
'brandName' => $val['brandName']
);
}
if (count($data) > 5) {
//大于5个返回更多品牌链接
if ($brandNumber > 5) {
self::$shopData['brandList']['url'] = Helpers::url('/product/index/allBrand', array('shop_id' => self::$shopId));
}
}
... ... @@ -170,7 +176,7 @@ class ShopProcess
{
if (isset($data['code']) && $data['code'] == 200 && !empty($data['data'])) {
$total = count($data['data']);
if ($total > 5) {
if ($total > 6) {
self::$shopData['shopCategory']['url'] = Helpers::url('/product/index/category', array('shop_id' => self::$shopId));
return;
}
... ...
... ... @@ -413,17 +413,12 @@ class ListModel
public static function shopData($shopId, $uid)
{
$data = array();
//TODO 用户是否收藏
if (!empty($uid)) {
}
//店铺信息
$data['shopInfo'] = ListData::getShopInfo($shopId, $uid);
//店铺分类
$data['shopCategory'] = ListData::getShopCategory($shopId);
//店铺装修资源数据
$data['decorator'] = ListData::getShopDecorator($shopId);
// print_r($data);
//组织楼层数据
$result = ShopProcess::formShopData($data, $shopId);
return $result;
... ...
... ... @@ -135,6 +135,11 @@ class IndexController extends AbstractAction
$uid = $this->getUid();
// 存标题信息
$title = '';
//TODO 如果是app,可直接获取shopId
// $appShopId = $this->get('shop_id');
// if ($this->isApp() && !empty($appShopId)) {
// $this->shop($appShopId);
// }
//TODO 通过品牌域名获取店铺shopId 先固定shopId = 672
$brandLogo = Product\ListModel::getBrandLogoByDomain($domain, $title);
$brandLogo['shopId'] = 672;
... ... @@ -147,8 +152,6 @@ class IndexController extends AbstractAction
$brandId = $brandLogo['id'];
}
/* 搜索框相关 */
$from = $this->get('from');
$query = $this->get('query');
... ...