...
|
...
|
@@ -28,9 +28,9 @@ class HomeController extends AbstractAction |
|
|
// 检查用户是否登录, 未登录则跳转到登录页
|
|
|
// @todo 为了方便测试,支持传uid参数
|
|
|
$uid = $this->getUid();
|
|
|
if (!$uid) {
|
|
|
/*if (!$uid) {
|
|
|
$uid = $this->_uid = $this->get('uid', 8826435); //$this->getUid(true);
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
$action = $this->getRequest()->getActionName();
|
|
|
if (!$uid && $action !== 'index') {
|
...
|
...
|
@@ -98,8 +98,8 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$favProducts = UserModel::getFavProductData($uid);
|
|
|
$favBrands = UserModel::getFavBrandData($uid, $gender);
|
|
|
$favProducts = UserModel::getFavProductData($this->_uid, 1, 10);
|
|
|
$favBrands = UserModel::getFavBrandData($this->_uid, 10, 1, 10);
|
|
|
|
|
|
$data = array(
|
|
|
'favPage' => true, //加载js
|
...
|
...
|
@@ -119,6 +119,44 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的商品数据获取接口
|
|
|
*/
|
|
|
public function favProductAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$page = $this->post('page', 1);
|
|
|
|
|
|
$result = UserModel::getFavProductData($this->_uid, $page, 10);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的品牌数据获取接口
|
|
|
*/
|
|
|
public function favBrandAction() {
|
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$page = $this->post('page', 1);
|
|
|
|
|
|
$result = UserModel::getFavBrandData($this->_uid, 10, $page, 10);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
|
|
echo ' ';
|
|
|
} else {
|
|
|
$this->echoJson($result);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 用户收藏的商品-删除
|
|
|
*/
|
|
|
public function favoriteDelAction()
|
...
|
...
|
@@ -205,6 +243,7 @@ class HomeController extends AbstractAction |
|
|
'couponsUrl' => UserModel::getCouponData($uid),
|
|
|
'couponsPage' => true
|
|
|
);
|
|
|
|
|
|
$this->_view->display('coupons', $coupons);
|
|
|
}
|
|
|
|
...
|
...
|
|