...
|
...
|
@@ -28,11 +28,11 @@ class HomeController extends AbstractAction |
|
|
// @todo 为了方便测试,支持传uid参数
|
|
|
$uid = $this->getUid();
|
|
|
if (!$uid) {
|
|
|
$uid = $this->_uid = $this->get('uid', 8826435); //$this->getUid(true);
|
|
|
$this->_uid = $this->get('uid', 8826435); //$this->getUid(true);
|
|
|
}
|
|
|
|
|
|
$action = $this->getRequest()->getActionName();
|
|
|
if (!$uid && $action !== 'index') {
|
|
|
if (!$this->_uid && $action !== 'index') {
|
|
|
$this->go(Helpers::url('/signin.html'));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -51,12 +51,14 @@ class HomeController extends AbstractAction |
|
|
'myIndexPage' => true,
|
|
|
'pageFooter' => true
|
|
|
);
|
|
|
$uid = $this->getUid();
|
|
|
if ($uid) {
|
|
|
|
|
|
if ($this->_uid) {
|
|
|
$data['isLogin'] = true;
|
|
|
$data += UserModel::getUserProfileData($uid);
|
|
|
$data += UserModel::getInfoNumData($uid);
|
|
|
$data += UserModel::getUserProfileData($this->_uid);
|
|
|
$data += UserModel::getInfoNumData($this->_uid);
|
|
|
|
|
|
// 优选新品数据
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$data['recommendForYou'] = UserModel::getPreferenceData($channel);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
...
|
...
|
@@ -91,10 +93,9 @@ class HomeController extends AbstractAction |
|
|
$this->setNavHeader('我的收藏', true, SITE_MAIN);
|
|
|
|
|
|
$tab = $this->get('tab', '');
|
|
|
$uid = $this->getUid();
|
|
|
|
|
|
$favProducts = UserModel::getFavProductData($uid);
|
|
|
$favBrands = UserModel::getFavBrandData($uid, 10, 1, 10);
|
|
|
$favProducts = UserModel::getFavProductData($this->_uid);
|
|
|
$favBrands = UserModel::getFavBrandData($this->_uid, 10, 1, 10);
|
|
|
|
|
|
$data = array(
|
|
|
'favPage' => true, //加载js
|
...
|
...
|
@@ -123,7 +124,7 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
$fav_id = $this->post('fav_id', 0);
|
|
|
|
|
|
$result = UserModel::favoriteDelete($uid, $fav_id);
|
|
|
$result = UserModel::favoriteDelete($this->_uid, $fav_id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -141,12 +142,11 @@ class HomeController extends AbstractAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 100);
|
|
|
|
|
|
$result = UserModel::browserRecord($uid, $udid, $page, $limit);
|
|
|
$result = UserModel::browserRecord($this->_uid, $udid, $page, $limit);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -159,12 +159,11 @@ class HomeController extends AbstractAction |
|
|
/**
|
|
|
* 个人信息
|
|
|
*/
|
|
|
public function personalDetailsAction() {
|
|
|
public function mydetailsAction() {
|
|
|
$this->setTitle('个人信息');
|
|
|
$this->setNavHeader('个人信息');
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$data = UserModel::getUserProfileData($uid);
|
|
|
$data = UserModel::getUserProfileData($this->_uid);
|
|
|
$data['personalDetailsPage'] = true;
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('personal-details', $data);
|
...
|
...
|
@@ -177,8 +176,7 @@ class HomeController extends AbstractAction |
|
|
$this->setTitle('YOHO币');
|
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$currency = UserModel::getYohoCoinData($uid);
|
|
|
$currency = UserModel::getYohoCoinData($this->_uid);
|
|
|
|
|
|
$currency['pageFooter'] = true;
|
|
|
$this->_view->display('currency', $currency);
|
...
|
...
|
@@ -192,11 +190,10 @@ class HomeController extends AbstractAction |
|
|
$this->setNavHeader('优惠券', true, SITE_MAIN);
|
|
|
|
|
|
// $uid = $this->getUid();
|
|
|
$uid = 8826435;
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => array(
|
|
|
'used' => \Index\UserModel::getCouponData($uid, 0),
|
|
|
'unused' => \Index\UserModel::getCouponData($uid, 1)
|
|
|
'used' => UserModel::getCouponData($this->_uid, 0),
|
|
|
'unused' => UserModel::getCouponData($this->_uid, 1)
|
|
|
),
|
|
|
'couponsPage' => true
|
|
|
);
|
...
|
...
|
@@ -210,11 +207,10 @@ class HomeController extends AbstractAction |
|
|
* 暂时使用老的,因后面APP、PC、WAP会进行一次改版
|
|
|
*/
|
|
|
public function messageAction() {
|
|
|
$uid = $this->getUid();
|
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
|
|
|
|
|
$messages = UserModel::getMessageData($uid, $page, $size);
|
|
|
$messages = UserModel::getMessageData($this->_uid, $page, $size);
|
|
|
|
|
|
print_r($messages);
|
|
|
}
|
...
|
...
|
@@ -227,9 +223,8 @@ class HomeController extends AbstractAction |
|
|
$this->setTitle('地址管理');
|
|
|
$this->setNavHeader('地址管理');
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$address = UserModel::getAddressData($uid);
|
|
|
$addressList = UserModel::getAddressListData($uid);
|
|
|
$address = UserModel::getAddressData($this->_uid);
|
|
|
$addressList = UserModel::getAddressListData($this->_uid);
|
|
|
|
|
|
$this->_view->display('address', array(
|
|
|
'addressPage' => true,
|
...
|
...
|
@@ -246,7 +241,6 @@ class HomeController extends AbstractAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$address = $this->post('address', '');
|
|
|
$area_code = $this->post('area_code', '');
|
|
|
$consignee = $this->post('consignee', '');
|
...
|
...
|
@@ -255,7 +249,7 @@ class HomeController extends AbstractAction |
|
|
$mobile = $this->post('mobile', '');
|
|
|
$zip_code = $this->post('zip_code', '');
|
|
|
|
|
|
$result = UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
|
|
$result = UserModel::saveAddressData($this->_uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -272,9 +266,8 @@ class HomeController extends AbstractAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$id = $this->post('id', '');
|
|
|
$result = UserModel::setDefaultAddress($uid, $id);
|
|
|
$result = UserModel::setDefaultAddress($this->_uid, $id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -291,10 +284,9 @@ class HomeController extends AbstractAction |
|
|
$result = array();
|
|
|
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$id = $this->post('id', '');
|
|
|
|
|
|
$result = UserModel::deleteAddress($uid, $id);
|
|
|
$result = UserModel::deleteAddress($this->_uid, $id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -338,10 +330,9 @@ class HomeController extends AbstractAction |
|
|
public function myGuangAction() {
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 10);
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = Helpers::getChannelByCookie();
|
|
|
$guangInfo = \Home\GuangModel::getMyGuang($uid, $page, $yh_channel, $gender, $limit);
|
|
|
$guangInfo = \Home\GuangModel::getMyGuang($this->_uid, $page, $yh_channel, $gender, $limit);
|
|
|
$totalPage = $guangInfo['totalPage'];
|
|
|
if ($page == 1) {
|
|
|
$this->setTitle('我收藏的');
|
...
|
...
|
@@ -412,11 +403,10 @@ class HomeController extends AbstractAction |
|
|
*/
|
|
|
public function savesuggestAction() {
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$content = $this->post('content', '');
|
|
|
$suggest_type = $this->post('suggest_type', 2);
|
|
|
$image = $this->post('image', null);
|
|
|
$result = UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
|
|
$result = UserModel::saveSuggestData($this->_uid, $content, $image, $suggest_type);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -427,10 +417,9 @@ class HomeController extends AbstractAction |
|
|
*/
|
|
|
public function upAndDownAction() {
|
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
$suggest_id = $this->post('suggest_id', 0);
|
|
|
$result = UserModel::upAndDown($uid, $udid, $suggest_id);
|
|
|
$result = UserModel::upAndDown($this->_uid, $udid, $suggest_id);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -444,9 +433,7 @@ class HomeController extends AbstractAction |
|
|
$this->setTitle('会员等级');
|
|
|
//显示网站导航头部信息
|
|
|
$this->setNavHeader('会员等级');
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '3566171'; //临时测试用
|
|
|
$data = GradeModel::getGrade($uid);
|
|
|
$data = GradeModel::getGrade($this->_uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
$this->_view->display('vip-grade', $data);
|
...
|
...
|
@@ -500,10 +487,8 @@ class HomeController extends AbstractAction |
|
|
$type = $this->get('type', 1);
|
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 10);
|
|
|
$uid = $this->getUid();
|
|
|
$uid = '12';//测试数据
|
|
|
//调用模型层getOrder方法获得并处理数据
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $uid);
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $this->_uid);
|
|
|
/* 如果取不到订单数据时,分两种情况:
|
|
|
1、page>1时,echo一个空格字符串到浏览器。
|
|
|
2、page=1时,就给一个随便逛逛的链接。
|
...
|
...
|
@@ -534,11 +519,10 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
//传入order_code和uid以取消订单
|
|
|
$order_code = $this->get('id');
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
//调用取消订单接口,返回订单取消状态
|
|
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel);
|
|
|
$data = OrderData::cancelOrderData($order_code, $this->_uid, $gender, $yh_channel);
|
|
|
//将取消状态返回至浏览器
|
|
|
$this->echoJson($data);
|
|
|
}
|
...
|
...
|
@@ -554,11 +538,10 @@ class HomeController extends AbstractAction |
|
|
}
|
|
|
//传入order_code和uid以删除订单
|
|
|
$order_code = $this->get('id');
|
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
//调用接口删除订单,并返回订单删除状态
|
|
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel);
|
|
|
$data = OrderData::deleteOrderData($order_code, $this->_uid, $gender, $yh_channel);
|
|
|
//将订单删除状态返回至浏览器
|
|
|
$this->echoJson($data);
|
|
|
}
|
...
|
...
|
|