...
|
...
|
@@ -166,29 +166,36 @@ class FavoriteModel |
|
|
$result = array('brands' => array('empty' => '您没有收藏品牌'), 'pager' => array());
|
|
|
$brand = FavoriteData::favoriteBrandData($uid, $page, $limit);
|
|
|
do {
|
|
|
|
|
|
if (empty($brand['data']) || empty($brand['data']['page_total'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
if ($brand['data']['page_total'] < $page) {
|
|
|
$page = $data['data']['page_total'];
|
|
|
$page = $brand['data']['page_total'];
|
|
|
$brand = FavoriteData::favoriteBrandData($uid, $page, $limit);
|
|
|
continue;
|
|
|
}
|
|
|
if (isset($brand['data']['brand_list'])) {
|
|
|
foreach ($brand['data']['brand_list'] as $brandkey => $brandval) {
|
|
|
$brands[$brandkey]['id'] = $brandval['brand_id']; //品牌id
|
|
|
$brands[$brandkey]['img'] = Images::getImageUrl($brandval['brand_ico'], 100, 100); //品牌缩略图
|
|
|
$brands[$brandkey]['url'] = Helpers::url('', '', $brandval['brand_domain']); //品牌链接
|
|
|
$brands[$brandkey]['name'] = $brandval['brand_name']; //品牌名
|
|
|
$brands[$brandkey]['naCount'] = $brandval['new_product_num']; //新品到着数量
|
|
|
$brands[$brandkey]['colCount'] = $brandval['brand_favorite_num']; //收藏人气
|
|
|
$result['brands'] = $brands;
|
|
|
}
|
|
|
$total = isset($brand['data']['total']) ? $brand['data']['total'] : 0; //消息总条数
|
|
|
$pageTotal = isset($brand['data']['page_total']) ? $brand['data']['page_total'] : 0; //总页数
|
|
|
$page = isset($brand['data']['page']) ? $brand['data']['page'] : 0; //当前页
|
|
|
$result['pager'] = self::getPager($page, $total, $pageTotal, $limit, $type);
|
|
|
|
|
|
if (empty($brand['data']['brand_list'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$brands = array();
|
|
|
foreach ($brand['data']['brand_list'] as $brandkey => $brandval) {
|
|
|
$brands[$brandkey]['id'] = $brandval['brand_id']; //品牌id
|
|
|
$brands[$brandkey]['brandOrShopType'] = empty($brandval['brandOrShopType']) ? '' : $brandval['brandOrShopType'];
|
|
|
$brands[$brandkey]['shop_id'] = empty($brandval['shop_id']) ? '' : $brandval['shop_id'];
|
|
|
$brands[$brandkey]['img'] = Images::getImageUrl($brandval['brand_ico'], 100, 100); //品牌缩略图
|
|
|
$brands[$brandkey]['url'] = Helpers::url('', '', $brandval['brand_domain']); //品牌链接
|
|
|
$brands[$brandkey]['name'] = $brandval['brand_name']; //品牌名
|
|
|
$brands[$brandkey]['naCount'] = $brandval['new_product_num']; //新品到着数量
|
|
|
$brands[$brandkey]['colCount'] = $brandval['brand_favorite_num']; //收藏人气
|
|
|
}
|
|
|
$result['brands'] = $brands;
|
|
|
$total = isset($brand['data']['total']) ? $brand['data']['total'] : 0; //消息总条数
|
|
|
$pageTotal = isset($brand['data']['page_total']) ? $brand['data']['page_total'] : 0; //总页数
|
|
|
$page = isset($brand['data']['page']) ? $brand['data']['page'] : 0; //当前页
|
|
|
$result['pager'] = self::getPager($page, $total, $pageTotal, $limit, $type);
|
|
|
}
|
|
|
while (false);
|
|
|
return $result;
|
...
|
...
|
|