Authored by hf

fixes bug to search list page show brand

... ... @@ -16,6 +16,7 @@ use Api\Sign;
*/
class BrandData
{
const URI_BRAND_TOPPOS = 'operations/api/v5/resource/get';
/**
... ... @@ -182,14 +183,20 @@ class BrandData
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function filterBrandData($condition, $order = 's_t_desc', $limit = 60, $page = 1)
public static function filterBrandData($condition)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.brand';
$param['page'] = $page;
$param['limit'] = $limit;
$param['order'] = $order;
$param += $condition;
if (!isset($param['order'])) {
$param['order'] = 's_t_desc';
}
if (!isset($param['limit'])) {
$param['limit'] = 60;
}
if (!isset($param['page'])) {
$param['page'] = 1;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -92,14 +92,20 @@ class ClassData
* @param integer $channel 表示频道号,1位男生,2为女生
* @return array 品类商品数据
*/
public static function filterClassData($condition, $order = 's_t_desc', $limit = 60, $page = 1)
public static function filterClassData($condition)
{
$param = Yohobuy::param();
$param['method'] = 'app.search.category';
$param['page'] = $page;
$param['limit'] = $limit;
$param['order'] = $order;
$param += $condition;
if (!isset($param['order'])) {
$param['order'] = 's_t_desc';
}
if (!isset($param['limit'])) {
$param['limit'] = 60;
}
if (!isset($param['page'])) {
$param['page'] = 1;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -171,6 +171,7 @@ class SearchController extends AbstractAction
$data['goodListPage'] = true;
$data['goodList'] = $condition;
$data['query'] = $query;
// 查询数据
if (!isset($condition['query'])) {
... ... @@ -233,9 +234,19 @@ class SearchController extends AbstractAction
}
$data = array();
// 查询品类数据
// 查询品类或品牌数据
if (!isset($condition['query'])) {
$data += Product\ListModel::getClassData($condition, $order, $page);
$condition['order'] = $order;
$condition['page'] = $page;
// 搜索品类
if (!isset($condition['brand'])) {
$data += Product\ListModel::getClassData($condition);
}
// 搜索品牌
else {
$title = '';
$data += Product\ListModel::getBrandData($condition, $title);
}
if (isset($data['filter'])) {
unset($data['filter']);
}
... ...