|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use Home\GradeModel;
|
|
|
use Home\OrderModel;
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Wap\Home\OrderData;
|
|
|
use Index\UserModel as UserModel;
|
|
|
|
|
|
/**
|
|
|
* 个人中心相关的控制器
|
...
|
...
|
@@ -49,12 +52,12 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
if ($uid) {
|
|
|
$data['isLogin'] = true;
|
|
|
$data += \Index\UserModel::getUserProfileData($uid);
|
|
|
$data += \Index\UserModel::getInfoNumData($uid);
|
|
|
$data += UserModel::getUserProfileData($uid);
|
|
|
$data += UserModel::getInfoNumData($uid);
|
|
|
|
|
|
// 优选新品数据
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
|
|
|
$data['recommendForYou'] = UserModel::getPreferenceData($channel);
|
|
|
}
|
|
|
|
|
|
$this->_view->display('index', $data);
|
...
|
...
|
@@ -73,8 +76,8 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$favProducts = \Index\UserModel::getFavProductData($uid);
|
|
|
$favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
|
|
|
$favProducts = UserModel::getFavProductData($uid);
|
|
|
$favBrands = UserModel::getFavBrandData($uid, $gender);
|
|
|
|
|
|
$data = array(
|
|
|
'favPage' => true, //加载js
|
...
|
...
|
@@ -104,7 +107,7 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
$fav_id = $this->post('fav_id', 0);
|
|
|
|
|
|
$result = \Index\UserModel::favoriteDelete($uid, $fav_id);
|
|
|
$result = UserModel::favoriteDelete($uid, $fav_id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -123,7 +126,7 @@ class HomeController extends AbstractAction |
|
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$data = \Index\UserModel::getUserProfileData($uid);
|
|
|
$data = UserModel::getUserProfileData($uid);
|
|
|
$data['personalDetailsPage'] = true;
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('personal-details', $data);
|
...
|
...
|
@@ -138,7 +141,7 @@ class HomeController extends AbstractAction |
|
|
$this->setNavHeader('YOHO币', true, false);
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$currency = \Index\UserModel::getYohoCoinData($uid);
|
|
|
$currency = UserModel::getYohoCoinData($uid);
|
|
|
|
|
|
$currency['pageFooter'] = true;
|
|
|
$this->_view->display('currency', $currency);
|
...
|
...
|
@@ -154,7 +157,7 @@ class HomeController extends AbstractAction |
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$coupons = array(
|
|
|
'couponsUrl' => \Index\UserModel::getCouponData($uid),
|
|
|
'couponsUrl' => UserModel::getCouponData($uid),
|
|
|
'couponsPage' => true
|
|
|
);
|
|
|
$this->_view->display('coupons', $coupons);
|
...
|
...
|
@@ -169,7 +172,7 @@ class HomeController extends AbstractAction |
|
|
$page = $this->get('page', 0);
|
|
|
$size = $this->get('size', 10);
|
|
|
|
|
|
$messages = \Index\UserModel::getMessageData($uid, $page, $size);
|
|
|
$messages = UserModel::getMessageData($uid, $page, $size);
|
|
|
|
|
|
print_r($messages);
|
|
|
}
|
...
|
...
|
@@ -184,8 +187,8 @@ class HomeController extends AbstractAction |
|
|
$this->setNavHeader('地址管理');
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$address = \Index\UserModel::getAddressData($uid);
|
|
|
$addressList = \Index\UserModel::getAddressListData($uid);
|
|
|
$address = UserModel::getAddressData($uid);
|
|
|
$addressList = UserModel::getAddressListData($uid);
|
|
|
|
|
|
$this->_view->display('address', array(
|
|
|
'addressPage' => true,
|
...
|
...
|
@@ -212,7 +215,7 @@ class HomeController extends AbstractAction |
|
|
$mobile = $this->post('mobile', '');
|
|
|
$zip_code = $this->post('zip_code', '');
|
|
|
|
|
|
$result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
|
|
$result = UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -232,7 +235,7 @@ class HomeController extends AbstractAction |
|
|
if ($this->isAjax()) {
|
|
|
$uid = $this->getUid();
|
|
|
$id = $this->post('id', '');
|
|
|
$result = \Index\UserModel::setDefaultAddress($uid, $id);
|
|
|
$result = UserModel::setDefaultAddress($uid, $id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -253,7 +256,7 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
$id = $this->post('id', '');
|
|
|
|
|
|
$result = \Index\UserModel::deleteAddress($uid, $id);
|
|
|
$result = UserModel::deleteAddress($uid, $id);
|
|
|
}
|
|
|
|
|
|
if (empty($result)) {
|
...
|
...
|
@@ -330,7 +333,7 @@ class HomeController extends AbstractAction |
|
|
$page = $this->get('page', 1);
|
|
|
$limit = $this->get('limit', 30);
|
|
|
|
|
|
$suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
|
|
|
$suggest = UserModel::getSuggestData($udid, $page, $limit);
|
|
|
|
|
|
$this->_view->display('suggest', array(
|
|
|
'suggestPage' => true, //加载js
|
...
|
...
|
@@ -368,7 +371,7 @@ class HomeController extends AbstractAction |
|
|
public function suggestimgUploadAction()
|
|
|
{
|
|
|
//$filename = $this->post('filename', '');
|
|
|
$result = \Index\UserModel::saveSuggestImg('fileData');
|
|
|
$result = UserModel::saveSuggestImg('fileData');
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -383,7 +386,7 @@ class HomeController extends AbstractAction |
|
|
$content = $this->post('content', '');
|
|
|
$suggest_type = $this->post('suggest_type', 2);
|
|
|
$image = $this->post('image', null);
|
|
|
$result = \Index\UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
|
|
$result = UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -398,7 +401,7 @@ class HomeController extends AbstractAction |
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
$suggest_id = $this->post('suggest_id', 0);
|
|
|
$result = \Index\UserModel::upAndDown($uid, $udid, $suggest_id);
|
|
|
$result = UserModel::upAndDown($uid, $udid, $suggest_id);
|
|
|
|
|
|
$this->echoJson($result);
|
|
|
}
|
...
|
...
|
@@ -417,7 +420,7 @@ class HomeController extends AbstractAction |
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this->getUid();
|
|
|
$data = \Home\GradeModel::getGrade($gender, $channel, $uid);
|
|
|
$data = GradeModel::getGrade($gender, $channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
$this->_view->display('vip-grade', $data);
|
|
|
}
|
...
|
...
|
@@ -434,7 +437,7 @@ class HomeController extends AbstractAction |
|
|
|
|
|
$channel = Helpers::getChannelByCookie();
|
|
|
$uid = $this->getUid();
|
|
|
$data = \Home\GradeModel::getPreferential($channel, $uid);
|
|
|
$data = GradeModel::getPreferential($channel, $uid);
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
$this->_view->display('privilege', $data);
|
...
|
...
|
@@ -449,7 +452,7 @@ class HomeController extends AbstractAction |
|
|
$type = $this->get('type', 1);
|
|
|
$this->setTitle('我的订单');
|
|
|
$this->setNavHeader('我的订单');
|
|
|
$data = \Home\OrderModel::getNavs($type);
|
|
|
$data = OrderModel::getNavs($type);
|
|
|
if (!empty($data)) {
|
|
|
$order['navs'] = $data;
|
|
|
} else {
|
...
|
...
|
@@ -478,7 +481,7 @@ class HomeController extends AbstractAction |
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$uid = $this->getUid();
|
|
|
//调用模型层getOrder方法获得并处理数据
|
|
|
$data = \Home\OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
|
|
$data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
|
|
/* 如果取不到订单数据时,分两种情况:
|
|
|
1、page>1时,echo一个空格字符串到浏览器。
|
|
|
2、page=1时,就给一个随便逛逛的链接。
|
...
|
...
|
@@ -515,7 +518,7 @@ class HomeController extends AbstractAction |
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$method = 'app.SpaceOrders.close';
|
|
|
//调用取消订单接口,返回订单取消状态
|
|
|
$data = \Home\OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
$data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
//将取消状态返回至浏览器
|
|
|
$this->echoJson($data);
|
|
|
}
|
...
|
...
|
@@ -537,7 +540,7 @@ class HomeController extends AbstractAction |
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
$method = 'app.SpaceOrders.delOrderByCode';
|
|
|
//调用接口删除订单,并返回订单删除状态
|
|
|
$data = \Home\OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
$data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
|
|
//将订单删除状态返回至浏览器
|
|
|
$this->echoJson($data);
|
|
|
}
|
...
|
...
|
@@ -550,7 +553,7 @@ class HomeController extends AbstractAction |
|
|
{
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
\Home\OrderModel::payment($gender, $yh_channel);
|
|
|
OrderModel::payment($gender, $yh_channel);
|
|
|
}
|
|
|
|
|
|
/*
|
...
|
...
|
@@ -563,7 +566,7 @@ class HomeController extends AbstractAction |
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
$yh_channel = $this->get('yh_channel', 1);
|
|
|
//调用接口获取随便逛逛url地址,并return数据
|
|
|
$data = \Home\OrderModel::stroll($gender, $yh_channel);
|
|
|
$data = OrderModel::stroll($gender, $yh_channel);
|
|
|
return $data;
|
|
|
}
|
|
|
|
...
|
...
|
|