1
|
<?php
|
1
|
<?php
|
2
|
|
2
|
|
3
|
use Action\AbstractAction;
|
3
|
use Action\AbstractAction;
|
|
|
4
|
+use Home\GradeModel;
|
|
|
5
|
+use Home\OrderModel;
|
4
|
use Plugin\Helpers;
|
6
|
use Plugin\Helpers;
|
5
|
use LibModels\Wap\Home\OrderData;
|
7
|
use LibModels\Wap\Home\OrderData;
|
|
|
8
|
+use Index\UserModel as UserModel;
|
6
|
|
9
|
|
7
|
/**
|
10
|
/**
|
8
|
* 个人中心相关的控制器
|
11
|
* 个人中心相关的控制器
|
|
@@ -49,12 +52,12 @@ class HomeController extends AbstractAction |
|
@@ -49,12 +52,12 @@ class HomeController extends AbstractAction |
49
|
$uid = $this->getUid();
|
52
|
$uid = $this->getUid();
|
50
|
if ($uid) {
|
53
|
if ($uid) {
|
51
|
$data['isLogin'] = true;
|
54
|
$data['isLogin'] = true;
|
52
|
- $data += \Index\UserModel::getUserProfileData($uid);
|
|
|
53
|
- $data += \Index\UserModel::getInfoNumData($uid);
|
55
|
+ $data += UserModel::getUserProfileData($uid);
|
|
|
56
|
+ $data += UserModel::getInfoNumData($uid);
|
54
|
|
57
|
|
55
|
// 优选新品数据
|
58
|
// 优选新品数据
|
56
|
$channel = Helpers::getChannelByCookie();
|
59
|
$channel = Helpers::getChannelByCookie();
|
57
|
- $data['recommendForYou'] = \Index\UserModel::getPreferenceData($channel);
|
60
|
+ $data['recommendForYou'] = UserModel::getPreferenceData($channel);
|
58
|
}
|
61
|
}
|
59
|
|
62
|
|
60
|
$this->_view->display('index', $data);
|
63
|
$this->_view->display('index', $data);
|
|
@@ -73,8 +76,8 @@ class HomeController extends AbstractAction |
|
@@ -73,8 +76,8 @@ class HomeController extends AbstractAction |
73
|
$uid = $this->getUid();
|
76
|
$uid = $this->getUid();
|
74
|
$gender = Helpers::getGenderByCookie();
|
77
|
$gender = Helpers::getGenderByCookie();
|
75
|
|
78
|
|
76
|
- $favProducts = \Index\UserModel::getFavProductData($uid);
|
|
|
77
|
- $favBrands = \Index\UserModel::getFavBrandData($uid, $gender);
|
79
|
+ $favProducts = UserModel::getFavProductData($uid);
|
|
|
80
|
+ $favBrands = UserModel::getFavBrandData($uid, $gender);
|
78
|
|
81
|
|
79
|
$data = array(
|
82
|
$data = array(
|
80
|
'favPage' => true, //加载js
|
83
|
'favPage' => true, //加载js
|
|
@@ -104,7 +107,7 @@ class HomeController extends AbstractAction |
|
@@ -104,7 +107,7 @@ class HomeController extends AbstractAction |
104
|
$uid = $this->getUid();
|
107
|
$uid = $this->getUid();
|
105
|
$fav_id = $this->post('fav_id', 0);
|
108
|
$fav_id = $this->post('fav_id', 0);
|
106
|
|
109
|
|
107
|
- $result = \Index\UserModel::favoriteDelete($uid, $fav_id);
|
110
|
+ $result = UserModel::favoriteDelete($uid, $fav_id);
|
108
|
}
|
111
|
}
|
109
|
|
112
|
|
110
|
if (empty($result)) {
|
113
|
if (empty($result)) {
|
|
@@ -123,7 +126,7 @@ class HomeController extends AbstractAction |
|
@@ -123,7 +126,7 @@ class HomeController extends AbstractAction |
123
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
126
|
$this->setNavHeader('个人信息', true, SITE_MAIN);
|
124
|
|
127
|
|
125
|
$uid = $this->getUid();
|
128
|
$uid = $this->getUid();
|
126
|
- $data = \Index\UserModel::getUserProfileData($uid);
|
129
|
+ $data = UserModel::getUserProfileData($uid);
|
127
|
$data['personalDetailsPage'] = true;
|
130
|
$data['personalDetailsPage'] = true;
|
128
|
$data['pageFooter'] = true;
|
131
|
$data['pageFooter'] = true;
|
129
|
$this->_view->display('personal-details', $data);
|
132
|
$this->_view->display('personal-details', $data);
|
|
@@ -138,7 +141,7 @@ class HomeController extends AbstractAction |
|
@@ -138,7 +141,7 @@ class HomeController extends AbstractAction |
138
|
$this->setNavHeader('YOHO币', true, false);
|
141
|
$this->setNavHeader('YOHO币', true, false);
|
139
|
|
142
|
|
140
|
$uid = $this->getUid();
|
143
|
$uid = $this->getUid();
|
141
|
- $currency = \Index\UserModel::getYohoCoinData($uid);
|
144
|
+ $currency = UserModel::getYohoCoinData($uid);
|
142
|
|
145
|
|
143
|
$currency['pageFooter'] = true;
|
146
|
$currency['pageFooter'] = true;
|
144
|
$this->_view->display('currency', $currency);
|
147
|
$this->_view->display('currency', $currency);
|
|
@@ -154,7 +157,7 @@ class HomeController extends AbstractAction |
|
@@ -154,7 +157,7 @@ class HomeController extends AbstractAction |
154
|
|
157
|
|
155
|
$uid = $this->getUid();
|
158
|
$uid = $this->getUid();
|
156
|
$coupons = array(
|
159
|
$coupons = array(
|
157
|
- 'couponsUrl' => \Index\UserModel::getCouponData($uid),
|
160
|
+ 'couponsUrl' => UserModel::getCouponData($uid),
|
158
|
'couponsPage' => true
|
161
|
'couponsPage' => true
|
159
|
);
|
162
|
);
|
160
|
$this->_view->display('coupons', $coupons);
|
163
|
$this->_view->display('coupons', $coupons);
|
|
@@ -169,7 +172,7 @@ class HomeController extends AbstractAction |
|
@@ -169,7 +172,7 @@ class HomeController extends AbstractAction |
169
|
$page = $this->get('page', 0);
|
172
|
$page = $this->get('page', 0);
|
170
|
$size = $this->get('size', 10);
|
173
|
$size = $this->get('size', 10);
|
171
|
|
174
|
|
172
|
- $messages = \Index\UserModel::getMessageData($uid, $page, $size);
|
175
|
+ $messages = UserModel::getMessageData($uid, $page, $size);
|
173
|
|
176
|
|
174
|
print_r($messages);
|
177
|
print_r($messages);
|
175
|
}
|
178
|
}
|
|
@@ -184,8 +187,8 @@ class HomeController extends AbstractAction |
|
@@ -184,8 +187,8 @@ class HomeController extends AbstractAction |
184
|
$this->setNavHeader('地址管理');
|
187
|
$this->setNavHeader('地址管理');
|
185
|
|
188
|
|
186
|
$uid = $this->getUid();
|
189
|
$uid = $this->getUid();
|
187
|
- $address = \Index\UserModel::getAddressData($uid);
|
|
|
188
|
- $addressList = \Index\UserModel::getAddressListData($uid);
|
190
|
+ $address = UserModel::getAddressData($uid);
|
|
|
191
|
+ $addressList = UserModel::getAddressListData($uid);
|
189
|
|
192
|
|
190
|
$this->_view->display('address', array(
|
193
|
$this->_view->display('address', array(
|
191
|
'addressPage' => true,
|
194
|
'addressPage' => true,
|
|
@@ -212,7 +215,7 @@ class HomeController extends AbstractAction |
|
@@ -212,7 +215,7 @@ class HomeController extends AbstractAction |
212
|
$mobile = $this->post('mobile', '');
|
215
|
$mobile = $this->post('mobile', '');
|
213
|
$zip_code = $this->post('zip_code', '');
|
216
|
$zip_code = $this->post('zip_code', '');
|
214
|
|
217
|
|
215
|
- $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);
|
216
|
}
|
219
|
}
|
217
|
|
220
|
|
218
|
if (empty($result)) {
|
221
|
if (empty($result)) {
|
|
@@ -232,7 +235,7 @@ class HomeController extends AbstractAction |
|
@@ -232,7 +235,7 @@ class HomeController extends AbstractAction |
232
|
if ($this->isAjax()) {
|
235
|
if ($this->isAjax()) {
|
233
|
$uid = $this->getUid();
|
236
|
$uid = $this->getUid();
|
234
|
$id = $this->post('id', '');
|
237
|
$id = $this->post('id', '');
|
235
|
- $result = \Index\UserModel::setDefaultAddress($uid, $id);
|
238
|
+ $result = UserModel::setDefaultAddress($uid, $id);
|
236
|
}
|
239
|
}
|
237
|
|
240
|
|
238
|
if (empty($result)) {
|
241
|
if (empty($result)) {
|
|
@@ -253,7 +256,7 @@ class HomeController extends AbstractAction |
|
@@ -253,7 +256,7 @@ class HomeController extends AbstractAction |
253
|
$uid = $this->getUid();
|
256
|
$uid = $this->getUid();
|
254
|
$id = $this->post('id', '');
|
257
|
$id = $this->post('id', '');
|
255
|
|
258
|
|
256
|
- $result = \Index\UserModel::deleteAddress($uid, $id);
|
259
|
+ $result = UserModel::deleteAddress($uid, $id);
|
257
|
}
|
260
|
}
|
258
|
|
261
|
|
259
|
if (empty($result)) {
|
262
|
if (empty($result)) {
|
|
@@ -330,7 +333,7 @@ class HomeController extends AbstractAction |
|
@@ -330,7 +333,7 @@ class HomeController extends AbstractAction |
330
|
$page = $this->get('page', 1);
|
333
|
$page = $this->get('page', 1);
|
331
|
$limit = $this->get('limit', 30);
|
334
|
$limit = $this->get('limit', 30);
|
332
|
|
335
|
|
333
|
- $suggest = \Index\UserModel::getSuggestData($udid, $page, $limit);
|
336
|
+ $suggest = UserModel::getSuggestData($udid, $page, $limit);
|
334
|
|
337
|
|
335
|
$this->_view->display('suggest', array(
|
338
|
$this->_view->display('suggest', array(
|
336
|
'suggestPage' => true, //加载js
|
339
|
'suggestPage' => true, //加载js
|
|
@@ -368,7 +371,7 @@ class HomeController extends AbstractAction |
|
@@ -368,7 +371,7 @@ class HomeController extends AbstractAction |
368
|
public function suggestimgUploadAction()
|
371
|
public function suggestimgUploadAction()
|
369
|
{
|
372
|
{
|
370
|
//$filename = $this->post('filename', '');
|
373
|
//$filename = $this->post('filename', '');
|
371
|
- $result = \Index\UserModel::saveSuggestImg('fileData');
|
374
|
+ $result = UserModel::saveSuggestImg('fileData');
|
372
|
|
375
|
|
373
|
$this->echoJson($result);
|
376
|
$this->echoJson($result);
|
374
|
}
|
377
|
}
|
|
@@ -383,7 +386,7 @@ class HomeController extends AbstractAction |
|
@@ -383,7 +386,7 @@ class HomeController extends AbstractAction |
383
|
$content = $this->post('content', '');
|
386
|
$content = $this->post('content', '');
|
384
|
$suggest_type = $this->post('suggest_type', 2);
|
387
|
$suggest_type = $this->post('suggest_type', 2);
|
385
|
$image = $this->post('image', null);
|
388
|
$image = $this->post('image', null);
|
386
|
- $result = \Index\UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
389
|
+ $result = UserModel::saveSuggestData($uid, $content, $image, $suggest_type);
|
387
|
|
390
|
|
388
|
$this->echoJson($result);
|
391
|
$this->echoJson($result);
|
389
|
}
|
392
|
}
|
|
@@ -398,7 +401,7 @@ class HomeController extends AbstractAction |
|
@@ -398,7 +401,7 @@ class HomeController extends AbstractAction |
398
|
$uid = $this->getUid();
|
401
|
$uid = $this->getUid();
|
399
|
$udid = $this->getUdid();
|
402
|
$udid = $this->getUdid();
|
400
|
$suggest_id = $this->post('suggest_id', 0);
|
403
|
$suggest_id = $this->post('suggest_id', 0);
|
401
|
- $result = \Index\UserModel::upAndDown($uid, $udid, $suggest_id);
|
404
|
+ $result = UserModel::upAndDown($uid, $udid, $suggest_id);
|
402
|
|
405
|
|
403
|
$this->echoJson($result);
|
406
|
$this->echoJson($result);
|
404
|
}
|
407
|
}
|
|
@@ -417,7 +420,7 @@ class HomeController extends AbstractAction |
|
@@ -417,7 +420,7 @@ class HomeController extends AbstractAction |
417
|
$gender = Helpers::getGenderByCookie();
|
420
|
$gender = Helpers::getGenderByCookie();
|
418
|
$channel = Helpers::getChannelByCookie();
|
421
|
$channel = Helpers::getChannelByCookie();
|
419
|
$uid = $this->getUid();
|
422
|
$uid = $this->getUid();
|
420
|
- $data = \Home\GradeModel::getGrade($gender, $channel, $uid);
|
423
|
+ $data = GradeModel::getGrade($gender, $channel, $uid);
|
421
|
$data['pageFooter'] = true;
|
424
|
$data['pageFooter'] = true;
|
422
|
$this->_view->display('vip-grade', $data);
|
425
|
$this->_view->display('vip-grade', $data);
|
423
|
}
|
426
|
}
|
|
@@ -434,7 +437,7 @@ class HomeController extends AbstractAction |
|
@@ -434,7 +437,7 @@ class HomeController extends AbstractAction |
434
|
|
437
|
|
435
|
$channel = Helpers::getChannelByCookie();
|
438
|
$channel = Helpers::getChannelByCookie();
|
436
|
$uid = $this->getUid();
|
439
|
$uid = $this->getUid();
|
437
|
- $data = \Home\GradeModel::getPreferential($channel, $uid);
|
440
|
+ $data = GradeModel::getPreferential($channel, $uid);
|
438
|
$data['pageFooter'] = true;
|
441
|
$data['pageFooter'] = true;
|
439
|
|
442
|
|
440
|
$this->_view->display('privilege', $data);
|
443
|
$this->_view->display('privilege', $data);
|
|
@@ -449,7 +452,7 @@ class HomeController extends AbstractAction |
|
@@ -449,7 +452,7 @@ class HomeController extends AbstractAction |
449
|
$type = $this->get('type', 1);
|
452
|
$type = $this->get('type', 1);
|
450
|
$this->setTitle('我的订单');
|
453
|
$this->setTitle('我的订单');
|
451
|
$this->setNavHeader('我的订单');
|
454
|
$this->setNavHeader('我的订单');
|
452
|
- $data = \Home\OrderModel::getNavs($type);
|
455
|
+ $data = OrderModel::getNavs($type);
|
453
|
if (!empty($data)) {
|
456
|
if (!empty($data)) {
|
454
|
$order['navs'] = $data;
|
457
|
$order['navs'] = $data;
|
455
|
} else {
|
458
|
} else {
|
|
@@ -478,7 +481,7 @@ class HomeController extends AbstractAction |
|
@@ -478,7 +481,7 @@ class HomeController extends AbstractAction |
478
|
$yh_channel = $this->get('yh_channel', 1);
|
481
|
$yh_channel = $this->get('yh_channel', 1);
|
479
|
$uid = $this->getUid();
|
482
|
$uid = $this->getUid();
|
480
|
//调用模型层getOrder方法获得并处理数据
|
483
|
//调用模型层getOrder方法获得并处理数据
|
481
|
- $data = \Home\OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
484
|
+ $data = OrderModel::getOrder($type, $page, $limit, $gender, $yh_channel, $uid);
|
482
|
/* 如果取不到订单数据时,分两种情况:
|
485
|
/* 如果取不到订单数据时,分两种情况:
|
483
|
1、page>1时,echo一个空格字符串到浏览器。
|
486
|
1、page>1时,echo一个空格字符串到浏览器。
|
484
|
2、page=1时,就给一个随便逛逛的链接。
|
487
|
2、page=1时,就给一个随便逛逛的链接。
|
|
@@ -515,7 +518,7 @@ class HomeController extends AbstractAction |
|
@@ -515,7 +518,7 @@ class HomeController extends AbstractAction |
515
|
$yh_channel = $this->get('yh_channel', 1);
|
518
|
$yh_channel = $this->get('yh_channel', 1);
|
516
|
$method = 'app.SpaceOrders.close';
|
519
|
$method = 'app.SpaceOrders.close';
|
517
|
//调用取消订单接口,返回订单取消状态
|
520
|
//调用取消订单接口,返回订单取消状态
|
518
|
- $data = \Home\OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
521
|
+ $data = OrderData::cancelOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
519
|
//将取消状态返回至浏览器
|
522
|
//将取消状态返回至浏览器
|
520
|
$this->echoJson($data);
|
523
|
$this->echoJson($data);
|
521
|
}
|
524
|
}
|
|
@@ -537,7 +540,7 @@ class HomeController extends AbstractAction |
|
@@ -537,7 +540,7 @@ class HomeController extends AbstractAction |
537
|
$yh_channel = $this->get('yh_channel', 1);
|
540
|
$yh_channel = $this->get('yh_channel', 1);
|
538
|
$method = 'app.SpaceOrders.delOrderByCode';
|
541
|
$method = 'app.SpaceOrders.delOrderByCode';
|
539
|
//调用接口删除订单,并返回订单删除状态
|
542
|
//调用接口删除订单,并返回订单删除状态
|
540
|
- $data = \Home\OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
543
|
+ $data = OrderData::deleteOrderData($order_code, $uid, $gender, $yh_channel, $method);
|
541
|
//将订单删除状态返回至浏览器
|
544
|
//将订单删除状态返回至浏览器
|
542
|
$this->echoJson($data);
|
545
|
$this->echoJson($data);
|
543
|
}
|
546
|
}
|
|
@@ -550,7 +553,7 @@ class HomeController extends AbstractAction |
|
@@ -550,7 +553,7 @@ class HomeController extends AbstractAction |
550
|
{
|
553
|
{
|
551
|
$gender = Helpers::getGenderByCookie();
|
554
|
$gender = Helpers::getGenderByCookie();
|
552
|
$yh_channel = $this->get('yh_channel', 1);
|
555
|
$yh_channel = $this->get('yh_channel', 1);
|
553
|
- \Home\OrderModel::payment($gender, $yh_channel);
|
556
|
+ OrderModel::payment($gender, $yh_channel);
|
554
|
}
|
557
|
}
|
555
|
|
558
|
|
556
|
/*
|
559
|
/*
|
|
@@ -563,7 +566,7 @@ class HomeController extends AbstractAction |
|
@@ -563,7 +566,7 @@ class HomeController extends AbstractAction |
563
|
$gender = Helpers::getGenderByCookie();
|
566
|
$gender = Helpers::getGenderByCookie();
|
564
|
$yh_channel = $this->get('yh_channel', 1);
|
567
|
$yh_channel = $this->get('yh_channel', 1);
|
565
|
//调用接口获取随便逛逛url地址,并return数据
|
568
|
//调用接口获取随便逛逛url地址,并return数据
|
566
|
- $data = \Home\OrderModel::stroll($gender, $yh_channel);
|
569
|
+ $data = OrderModel::stroll($gender, $yh_channel);
|
567
|
return $data;
|
570
|
return $data;
|
568
|
}
|
571
|
}
|
569
|
|
572
|
|