1
|
<?php
|
1
|
<?php
|
2
|
|
2
|
|
3
|
use Action\AbstractAction;
|
3
|
use Action\AbstractAction;
|
4
|
-use home\GradeModel;
|
4
|
+use Home\GradeModel;
|
5
|
use home\OrderModel;
|
5
|
use home\OrderModel;
|
6
|
use Plugin\Helpers;
|
6
|
use Plugin\Helpers;
|
7
|
use LibModels\Wap\Home\OrderData;
|
7
|
use LibModels\Wap\Home\OrderData;
|
|
|
8
|
+use Index\UserModel as UserModel;
|
8
|
|
9
|
|
9
|
/**
|
10
|
/**
|
10
|
* 个人中心相关的控制器
|
11
|
* 个人中心相关的控制器
|
|
@@ -51,12 +52,12 @@ class HomeController extends AbstractAction |
|
@@ -51,12 +52,12 @@ class HomeController extends AbstractAction |
51
|
$uid = $this->getUid();
|
52
|
$uid = $this->getUid();
|
52
|
if ($uid) {
|
53
|
if ($uid) {
|
53
|
$data['isLogin'] = true;
|
54
|
$data['isLogin'] = true;
|
54
|
- $data += \Index\UserModel::getUserProfileData($uid);
|
|
|
55
|
- $data += \Index\UserModel::getInfoNumData($uid);
|
55
|
+ $data += UserModel::getUserProfileData($uid);
|
|
|
56
|
+ $data += UserModel::getInfoNumData($uid);
|
56
|
|
57
|
|
57
|
// 优选新品数据
|
58
|
// 优选新品数据
|
58
|
$channel = Helpers::getChannelByCookie();
|
59
|
$channel = Helpers::getChannelByCookie();
|
59
|
- $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
|
60
|
+ $data['recommendForYou'] = UserModel::getPreferenceData($channel);
|
60
|
}
|
61
|
}
|
61
|
|
62
|
|
62
|
$this->_view->display('index', $data);
|
63
|
$this->_view->display('index', $data);
|
|
@@ -75,8 +76,8 @@ class HomeController extends AbstractAction |
|
@@ -75,8 +76,8 @@ class HomeController extends AbstractAction |
75
|
$uid = $this->getUid();
|
76
|
$uid = $this->getUid();
|
76
|
$gender = Helpers::getGenderByCookie();
|
77
|
$gender = Helpers::getGenderByCookie();
|
77
|
|
78
|
|
78
|
- $favProducts = \Index\UserModel::getFavProductData($uid);
|
|
|
79
|
- $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
|
79
|
+ $favProducts = UserModel::getFavProductData($uid);
|
|
|
80
|
+ $favBrands = UserModel::getFavBrandData($uid, $gender);
|
80
|
|
81
|
|
81
|
$data = array(
|
82
|
$data = array(
|
82
|
'favPage' => true, //加载js
|
83
|
'favPage' => true, //加载js
|
|
@@ -106,7 +107,7 @@ class HomeController extends AbstractAction |
|
@@ -106,7 +107,7 @@ class HomeController extends AbstractAction |
106
|
$uid = $this->getUid();
|
107
|
$uid = $this->getUid();
|
107
|
$fav_id = $this->post('fav_id', 0);
|
108
|
$fav_id = $this->post('fav_id', 0);
|
108
|
|
109
|
|
109
|
- $result = \Index\UserModel::favoriteDelete($uid, $fav_id);
|
110
|
+ $result = UserModel::favoriteDelete($uid, $fav_id);
|
110
|
}
|
111
|
}
|
111
|
|
112
|
|
112
|
if (empty($result)) {
|
113
|
if (empty($result)) {
|
|
@@ -125,7 +126,7 @@ class HomeController extends AbstractAction |
|
@@ -125,7 +126,7 @@ class HomeController extends AbstractAction |
125
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
126
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
126
|
|
127
|
|
127
|
$uid = $this->getUid();
|
128
|
$uid = $this->getUid();
|
128
|
- $data = \Index\UserModel::getUserProfileData($uid);
|
129
|
+ $data = UserModel::getUserProfileData($uid);
|
129
|
$data['personalDetailsPage'] = true;
|
130
|
$data['personalDetailsPage'] = true;
|
130
|
$data['pageFooter'] = true;
|
131
|
$data['pageFooter'] = true;
|
131
|
$this->_view->display('personal-details', $data);
|
132
|
$this->_view->display('personal-details', $data);
|
|
@@ -140,7 +141,7 @@ class HomeController extends AbstractAction |
|
@@ -140,7 +141,7 @@ class HomeController extends AbstractAction |
140
|
$this->setNavHeader('YOHO币', true, false);
|
141
|
$this->setNavHeader('YOHO币', true, false);
|
141
|
|
142
|
|
142
|
$uid = $this->getUid();
|
143
|
$uid = $this->getUid();
|
143
|
- $currency = \Index\UserModel::getYohoCoinData($uid);
|
144
|
+ $currency = UserModel::getYohoCoinData($uid);
|
144
|
|
145
|
|
145
|
$currency['pageFooter'] = true;
|
146
|
$currency['pageFooter'] = true;
|
146
|
$this->_view->display('currency', $currency);
|
147
|
$this->_view->display('currency', $currency);
|
|
@@ -156,7 +157,7 @@ class HomeController extends AbstractAction |
|
@@ -156,7 +157,7 @@ class HomeController extends AbstractAction |
156
|
|
157
|
|
157
|
$uid = $this->getUid();
|
158
|
$uid = $this->getUid();
|
158
|
$coupons = array(
|
159
|
$coupons = array(
|
159
|
- 'couponsUrl' => \Index\UserModel::getCouponData($uid),
|
160
|
+ 'couponsUrl' => UserModel::getCouponData($uid),
|
160
|
'couponsPage' => true
|
161
|
'couponsPage' => true
|
161
|
);
|
162
|
);
|
162
|
$this->_view->display('coupons', $coupons);
|
163
|
$this->_view->display('coupons', $coupons);
|
|
@@ -171,7 +172,7 @@ class HomeController extends AbstractAction |
|
@@ -171,7 +172,7 @@ class HomeController extends AbstractAction |
171
|
$page = $this->get('page', 0);
|
172
|
$page = $this->get('page', 0);
|
172
|
$size = $this->get('size', 10);
|
173
|
$size = $this->get('size', 10);
|
173
|
|
174
|
|
174
|
- $messages = \Index\UserModel::getMessageData($uid, $page, $size);
|
175
|
+ $messages = UserModel::getMessageData($uid, $page, $size);
|
175
|
|
176
|
|
176
|
print_r($messages);
|
177
|
print_r($messages);
|
177
|
}
|
178
|
}
|
|
@@ -186,8 +187,8 @@ class HomeController extends AbstractAction |
|
@@ -186,8 +187,8 @@ class HomeController extends AbstractAction |
186
|
$this->setNavHeader('地址管理');
|
187
|
$this->setNavHeader('地址管理');
|
187
|
|
188
|
|
188
|
$uid = $this->getUid();
|
189
|
$uid = $this->getUid();
|
189
|
- $address = \Index\UserModel::getAddressData($uid);
|
|
|
190
|
- $addressList = \Index\UserModel::getAddressListData($uid);
|
190
|
+ $address = UserModel::getAddressData($uid);
|
|
|
191
|
+ $addressList = UserModel::getAddressListData($uid);
|
191
|
|
192
|
|
192
|
$this->_view->display('address', array(
|
193
|
$this->_view->display('address', array(
|
193
|
'addressPage' => true,
|
194
|
'addressPage' => true,
|
|
@@ -214,7 +215,7 @@ class HomeController extends AbstractAction |
|
@@ -214,7 +215,7 @@ class HomeController extends AbstractAction |
214
|
$mobile = $this->post('mobile', '');
|
215
|
$mobile = $this->post('mobile', '');
|
215
|
$zip_code = $this->post('zip_code', '');
|
216
|
$zip_code = $this->post('zip_code', '');
|
216
|
|
217
|
|
217
|
- $result = \Index\UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
218
|
+ $result = UserModel::saveAddressData($uid, $address, $area_code, $consignee, $email, $id, $mobile, $zip_code);
|
218
|
}
|
219
|
}
|
219
|
|
220
|
|
220
|
if (empty($result)) {
|
221
|
if (empty($result)) {
|
|
@@ -234,7 +235,7 @@ class HomeController extends AbstractAction |
|
@@ -234,7 +235,7 @@ class HomeController extends AbstractAction |
234
|
if ($this->isAjax()) {
|
235
|
if ($this->isAjax()) {
|
235
|
$uid = $this->getUid();
|
236
|
$uid = $this->getUid();
|
236
|
$id = $this->post('id', '');
|
237
|
$id = $this->post('id', '');
|
237
|
- $result = \Index\UserModel::setDefaultAddress($uid, $id);
|
238
|
+ $result = UserModel::setDefaultAddress($uid, $id);
|
238
|
}
|
239
|
}
|
239
|
|
240
|
|
240
|
if (empty($result)) {
|
241
|
if (empty($result)) {
|
|
@@ -255,7 +256,7 @@ class HomeController extends AbstractAction |
|
@@ -255,7 +256,7 @@ class HomeController extends AbstractAction |
255
|
$uid = $this->getUid();
|
256
|
$uid = $this->getUid();
|
256
|
$id = $this->post('id', '');
|
257
|
$id = $this->post('id', '');
|
257
|
|
258
|
|
258
|
- $result = \Index\UserModel::deleteAddress($uid, $id);
|
259
|
+ $result = UserModel::deleteAddress($uid, $id);
|
259
|
}
|
260
|
}
|
260
|
|
261
|
|
261
|
if (empty($result)) {
|
262
|
if (empty($result)) {
|
|
@@ -332,7 +333,7 @@ class HomeController extends AbstractAction |
|
@@ -332,7 +333,7 @@ class HomeController extends AbstractAction |
332
|
$page = $this->get('page', 1);
|
333
|
$page = $this->get('page', 1);
|
333
|
$limit = $this->get('limit', 30);
|
334
|
$limit = $this->get('limit', 30);
|
334
|
|
335
|
|
335
|
- $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
|
336
|
+ $suggest = UserModel::getSuggestData($udid, $page, $limit);
|
336
|
|
337
|
|
337
|
$this->_view->display('suggest', array(
|
338
|
$this->_view->display('suggest', array(
|
338
|
'suggestPage' => true, //加载js
|
339
|
'suggestPage' => true, //加载js
|
|
@@ -370,7 +371,7 @@ class HomeController extends AbstractAction |
|
@@ -370,7 +371,7 @@ class HomeController extends AbstractAction |
370
|
public function suggestimgUploadAction()
|
371
|
public function suggestimgUploadAction()
|
371
|
{
|
372
|
{
|
372
|
//$filename = $this->post('filename', '');
|
373
|
//$filename = $this->post('filename', '');
|
373
|
- $result = \Index\UserModel::saveSuggestImg('fileData');
|
374
|
+ $result = UserModel::saveSuggestImg('fileData');
|
374
|
|
375
|
|
375
|
$this->echoJson($result);
|
376
|
$this->echoJson($result);
|
376
|
}
|
377
|
}
|
|
@@ -385,7 +386,7 @@ class HomeController extends AbstractAction |
|
@@ -385,7 +386,7 @@ class HomeController extends AbstractAction |
385
|
$content = $this->post('content', '');
|
386
|
$content = $this->post('content', '');
|
386
|
$suggest_type = $this->post('suggest_type', 2);
|
387
|
$suggest_type = $this->post('suggest_type', 2);
|
387
|
$image = $this->post('image', null);
|
388
|
$image = $this->post('image', null);
|
388
|
- $result = \Index\UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
389
|
+ $result = UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
389
|
|
390
|
|
390
|
$this->echoJson($result);
|
391
|
$this->echoJson($result);
|
391
|
}
|
392
|
}
|
|
@@ -400,7 +401,7 @@ class HomeController extends AbstractAction |
|
@@ -400,7 +401,7 @@ class HomeController extends AbstractAction |
400
|
$uid = $this->getUid();
|
401
|
$uid = $this->getUid();
|
401
|
$udid = $this->getUdid();
|
402
|
$udid = $this->getUdid();
|
402
|
$suggest_id = $this->post('suggest_id', 0);
|
403
|
$suggest_id = $this->post('suggest_id', 0);
|
403
|
- $result = \Index\UserModel::upAndDown($uid, $udid, $suggest_id);
|
404
|
+ $result = UserModel::upAndDown($uid, $udid, $suggest_id);
|
404
|
|
405
|
|
405
|
$this->echoJson($result);
|
406
|
$this->echoJson($result);
|
406
|
}
|
407
|
}
|