|
|
<?php
|
|
|
|
|
|
use Action\AbstractAction;
|
|
|
use home\GradeModel;
|
|
|
use Home\GradeModel;
|
|
|
use home\OrderModel;
|
|
|
use Plugin\Helpers;
|
|
|
use LibModels\Wap\Home\OrderData;
|
|
|
use Index\UserModel as UserModel;
|
|
|
|
|
|
/**
|
|
|
* 个人中心相关的控制器
|
...
|
...
|
@@ -51,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);
|
...
|
...
|
@@ -75,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
|
...
|
...
|
@@ -106,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)) {
|
...
|
...
|
@@ -125,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);
|
...
|
...
|
@@ -140,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);
|
...
|
...
|
@@ -156,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);
|
...
|
...
|
@@ -171,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);
|
|
|
}
|
...
|
...
|
@@ -186,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,
|
...
|
...
|
@@ -214,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)) {
|
...
|
...
|
@@ -234,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)) {
|
...
|
...
|
@@ -255,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)) {
|
...
|
...
|
@@ -332,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
|
...
|
...
|
@@ -370,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);
|
|
|
}
|
...
|
...
|
@@ -385,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);
|
|
|
}
|
...
|
...
|
@@ -400,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);
|
|
|
}
|
...
|
...
|
|