...
|
...
|
@@ -23,66 +23,66 @@ class IndexController extends AbstractAction |
|
|
*/
|
|
|
public function indexAction()
|
|
|
{
|
|
|
// // 过滤请求参数
|
|
|
// $condition = filter_input_array(INPUT_GET, array(
|
|
|
// 'brand' => FILTER_DEFAULT,
|
|
|
// 'sort' => FILTER_DEFAULT,
|
|
|
// 'msort' => FILTER_DEFAULT,
|
|
|
// 'misort' => FILTER_DEFAULT,
|
|
|
// 'color' => FILTER_DEFAULT,
|
|
|
// 'size' => FILTER_DEFAULT,
|
|
|
// 'style' => FILTER_DEFAULT,
|
|
|
// 'price' => FILTER_DEFAULT,
|
|
|
// 'discount' => FILTER_DEFAULT,
|
|
|
// 'gender' => FILTER_DEFAULT,
|
|
|
// 'p_d' => FILTER_DEFAULT,), false);
|
|
|
//
|
|
|
// // 转义品牌
|
|
|
// if (isset($condition['brand'])) {
|
|
|
// $condition['brand'] = rawurldecode($condition['brand']);
|
|
|
// }
|
|
|
// // 转义分类
|
|
|
// if (isset($condition['sort'])) {
|
|
|
// $condition['sort'] = rawurldecode($condition['sort']);
|
|
|
// }
|
|
|
// // 转义一级分类
|
|
|
// if (isset($condition['msort'])) {
|
|
|
// $condition['msort'] = rawurldecode($condition['msort']);
|
|
|
// }
|
|
|
// // 转义二级分类
|
|
|
// if (isset($condition['misort'])) {
|
|
|
// $condition['misort'] = rawurldecode($condition['misort']);
|
|
|
// }
|
|
|
// // 转义颜色
|
|
|
// if (isset($condition['color'])) {
|
|
|
// $condition['color'] = rawurldecode($condition['color']);
|
|
|
// }
|
|
|
// // 转义尺码
|
|
|
// if (isset($condition['size'])) {
|
|
|
// $condition['size'] = rawurldecode($condition['size']);
|
|
|
// }
|
|
|
// // 转义风格
|
|
|
// if (isset($condition['style'])) {
|
|
|
// $condition['style'] = rawurldecode($condition['style']);
|
|
|
// }
|
|
|
// // 转义价格
|
|
|
// if (isset($condition['price'])) {
|
|
|
// $condition['price'] = rawurldecode($condition['price']);
|
|
|
// }
|
|
|
// // 转换折扣
|
|
|
// if (isset($condition['discount'])) {
|
|
|
// $condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
// }
|
|
|
// // 为了兼容现在运营在用的p_d
|
|
|
// if (isset($condition['p_d'])) {
|
|
|
// $condition['discount'] = rawurldecode($condition['p_d']);
|
|
|
// }
|
|
|
// // 性别参数,不传则从COOKIE获取
|
|
|
// if (!isset($condition['gender'])) {
|
|
|
// $condition['gender'] = Helpers::getGenderByCookie();
|
|
|
// } else {
|
|
|
// $condition['gender'] = rawurldecode($condition['gender']);
|
|
|
// }
|
|
|
// 过滤请求参数
|
|
|
$condition = filter_input_array(INPUT_GET, array(
|
|
|
'brand' => FILTER_DEFAULT,
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'msort' => FILTER_DEFAULT,
|
|
|
'misort' => FILTER_DEFAULT,
|
|
|
'color' => FILTER_DEFAULT,
|
|
|
'size' => FILTER_DEFAULT,
|
|
|
'style' => FILTER_DEFAULT,
|
|
|
'price' => FILTER_DEFAULT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
|
|
|
|
|
// 转义品牌
|
|
|
if (isset($condition['brand'])) {
|
|
|
$condition['brand'] = rawurldecode($condition['brand']);
|
|
|
}
|
|
|
// 转义分类
|
|
|
if (isset($condition['sort'])) {
|
|
|
$condition['sort'] = rawurldecode($condition['sort']);
|
|
|
}
|
|
|
// 转义一级分类
|
|
|
if (isset($condition['msort'])) {
|
|
|
$condition['msort'] = rawurldecode($condition['msort']);
|
|
|
}
|
|
|
// 转义二级分类
|
|
|
if (isset($condition['misort'])) {
|
|
|
$condition['misort'] = rawurldecode($condition['misort']);
|
|
|
}
|
|
|
// 转义颜色
|
|
|
if (isset($condition['color'])) {
|
|
|
$condition['color'] = rawurldecode($condition['color']);
|
|
|
}
|
|
|
// 转义尺码
|
|
|
if (isset($condition['size'])) {
|
|
|
$condition['size'] = rawurldecode($condition['size']);
|
|
|
}
|
|
|
// 转义风格
|
|
|
if (isset($condition['style'])) {
|
|
|
$condition['style'] = rawurldecode($condition['style']);
|
|
|
}
|
|
|
// 转义价格
|
|
|
if (isset($condition['price'])) {
|
|
|
$condition['price'] = rawurldecode($condition['price']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
}
|
|
|
// 为了兼容现在运营在用的p_d
|
|
|
if (isset($condition['p_d'])) {
|
|
|
$condition['discount'] = rawurldecode($condition['p_d']);
|
|
|
}
|
|
|
// 性别参数,不传则从COOKIE获取
|
|
|
if (!isset($condition['gender'])) {
|
|
|
$condition['gender'] = Helpers::getGenderByCookie();
|
|
|
} else {
|
|
|
$condition['gender'] = rawurldecode($condition['gender']);
|
|
|
}
|
|
|
|
|
|
// 品类名称参数, 不传则默认为全部
|
|
|
$name = $this->get('sort_name');
|
...
|
...
|
@@ -92,11 +92,10 @@ class IndexController extends AbstractAction |
|
|
$this->setTitle($name);
|
|
|
$this->setNavHeader($name, true, SITE_MAIN);
|
|
|
|
|
|
// if (!$condition) {
|
|
|
// $condition = array();
|
|
|
// }
|
|
|
// $goodList = $condition;
|
|
|
$goodList = array();
|
|
|
if (!$condition) {
|
|
|
$condition = array();
|
|
|
}
|
|
|
$goodList = $condition;
|
|
|
$goodList['cartUrl'] = Helpers::url('/cart/index/index', null);
|
|
|
|
|
|
$this->_view->display('index', array(
|
...
|
...
|
@@ -133,13 +132,6 @@ class IndexController extends AbstractAction |
|
|
$brandId = $brandLogo['id'];
|
|
|
}
|
|
|
|
|
|
/* 通过品牌域名找到对应的品牌ID */
|
|
|
// $domainList = Product\ListModel::getAllBrandDomains();
|
|
|
// $brandIds = array_keys($domainList, $domain);
|
|
|
// $brandId = 0;
|
|
|
// if (isset($brandIds[0])) {
|
|
|
// $brandId = $brandIds[0];
|
|
|
// }
|
|
|
// 当前的登录用户UID
|
|
|
$uid = $this->getUid();
|
|
|
|
...
|
...
|
@@ -147,64 +139,64 @@ class IndexController extends AbstractAction |
|
|
$from = $this->get('from');
|
|
|
$query = $this->get('query');
|
|
|
|
|
|
// /* 过滤请求参数 */
|
|
|
// $condition = filter_input_array(INPUT_GET, array(
|
|
|
// 'sort' => FILTER_DEFAULT,
|
|
|
// 'msort' => FILTER_DEFAULT,
|
|
|
// 'misort' => FILTER_DEFAULT,
|
|
|
// 'color' => FILTER_DEFAULT,
|
|
|
// 'size' => FILTER_DEFAULT,
|
|
|
// 'style' => FILTER_DEFAULT,
|
|
|
// 'price' => FILTER_DEFAULT,
|
|
|
// 'discount' => FILTER_DEFAULT,
|
|
|
// 'gender' => FILTER_DEFAULT,
|
|
|
// 'p_d' => FILTER_DEFAULT,), false);
|
|
|
// $condition['brand'] = $brandId;
|
|
|
// // 转义分类
|
|
|
// if (isset($condition['sort'])) {
|
|
|
// $condition['sort'] = rawurldecode($condition['sort']);
|
|
|
// }
|
|
|
// // 转义一级分类
|
|
|
// if (isset($condition['msort'])) {
|
|
|
// $condition['msort'] = rawurldecode($condition['msort']);
|
|
|
// }
|
|
|
// // 转义二级分类
|
|
|
// if (isset($condition['misort'])) {
|
|
|
// $condition['misort'] = rawurldecode($condition['misort']);
|
|
|
// }
|
|
|
// // 转义颜色
|
|
|
// if (isset($condition['color'])) {
|
|
|
// $condition['color'] = rawurldecode($condition['color']);
|
|
|
// }
|
|
|
// // 转义尺码
|
|
|
// if (isset($condition['size'])) {
|
|
|
// $condition['size'] = rawurldecode($condition['size']);
|
|
|
// }
|
|
|
// // 转义风格
|
|
|
// if (isset($condition['style'])) {
|
|
|
// $condition['style'] = rawurldecode($condition['style']);
|
|
|
// }
|
|
|
// // 转义价格
|
|
|
// if (isset($condition['price'])) {
|
|
|
// $condition['price'] = rawurldecode($condition['price']);
|
|
|
// }
|
|
|
// // 转换折扣
|
|
|
// if (isset($condition['discount'])) {
|
|
|
// $condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
// }
|
|
|
// // 为了兼容现在运营在用的p_d
|
|
|
// if (isset($condition['p_d'])) {
|
|
|
// $condition['discount'] = rawurldecode($condition['p_d']);
|
|
|
// }
|
|
|
// if ($brandId === 0) {
|
|
|
// $condition['query'] = $domain;
|
|
|
// }
|
|
|
//
|
|
|
// if (isset($condition['gender'])) {
|
|
|
// $condition['gender'] = rawurldecode($condition['gender']);
|
|
|
// } else {
|
|
|
// $condition['gender'] = Helpers::getGenderByCookie();
|
|
|
// }
|
|
|
/* 过滤请求参数 */
|
|
|
$condition = filter_input_array(INPUT_GET, array(
|
|
|
'sort' => FILTER_DEFAULT,
|
|
|
'msort' => FILTER_DEFAULT,
|
|
|
'misort' => FILTER_DEFAULT,
|
|
|
'color' => FILTER_DEFAULT,
|
|
|
'size' => FILTER_DEFAULT,
|
|
|
'style' => FILTER_DEFAULT,
|
|
|
'price' => FILTER_DEFAULT,
|
|
|
'discount' => FILTER_DEFAULT,
|
|
|
'gender' => FILTER_DEFAULT,
|
|
|
'p_d' => FILTER_DEFAULT,), false);
|
|
|
$condition['brand'] = $brandId;
|
|
|
// 转义分类
|
|
|
if (isset($condition['sort'])) {
|
|
|
$condition['sort'] = rawurldecode($condition['sort']);
|
|
|
}
|
|
|
// 转义一级分类
|
|
|
if (isset($condition['msort'])) {
|
|
|
$condition['msort'] = rawurldecode($condition['msort']);
|
|
|
}
|
|
|
// 转义二级分类
|
|
|
if (isset($condition['misort'])) {
|
|
|
$condition['misort'] = rawurldecode($condition['misort']);
|
|
|
}
|
|
|
// 转义颜色
|
|
|
if (isset($condition['color'])) {
|
|
|
$condition['color'] = rawurldecode($condition['color']);
|
|
|
}
|
|
|
// 转义尺码
|
|
|
if (isset($condition['size'])) {
|
|
|
$condition['size'] = rawurldecode($condition['size']);
|
|
|
}
|
|
|
// 转义风格
|
|
|
if (isset($condition['style'])) {
|
|
|
$condition['style'] = rawurldecode($condition['style']);
|
|
|
}
|
|
|
// 转义价格
|
|
|
if (isset($condition['price'])) {
|
|
|
$condition['price'] = rawurldecode($condition['price']);
|
|
|
}
|
|
|
// 转换折扣
|
|
|
if (isset($condition['discount'])) {
|
|
|
$condition['p_d'] = rawurldecode($condition['discount']);
|
|
|
}
|
|
|
// 为了兼容现在运营在用的p_d
|
|
|
if (isset($condition['p_d'])) {
|
|
|
$condition['discount'] = rawurldecode($condition['p_d']);
|
|
|
}
|
|
|
if ($brandId === 0) {
|
|
|
$condition['query'] = $domain;
|
|
|
}
|
|
|
|
|
|
if (isset($condition['gender'])) {
|
|
|
$condition['gender'] = rawurldecode($condition['gender']);
|
|
|
} else {
|
|
|
$condition['gender'] = Helpers::getGenderByCookie();
|
|
|
}
|
|
|
|
|
|
$data = array();
|
|
|
$data['goodListPage'] = true;
|
...
|
...
|
|