Authored by Rock Zhang

Merge branch 'java-api' of git.dev.yoho.cn:web/yohobuy into java-api

Conflicts:
	yohobuy/m.yohobuy.com/application/controllers/Home.php
@@ -25,12 +25,10 @@ class OrderData @@ -25,12 +25,10 @@ class OrderData
25 */ 25 */
26 26
27 static function getOrderData($type, $page, $limit, $uid) { 27 static function getOrderData($type, $page, $limit, $uid) {
28 - $param['limit'] = '10';  
29 - $param['page'] = 1;  
30 - $param['type'] = 1;  
31 - $param['uid'] = '12';  
32 -// $param['iscancel'] = false;  
33 -// $param['paymentStatus'] = 'Y'; 28 + $param['limit'] = $limit;
  29 + $param['page'] = $page;
  30 + $param['type'] = $type;
  31 + $param['uid'] = $uid;
34 return Yohobuy::jsonPost(Yohobuy::YOHOBUY_ORDER.'orderInfo/getOrderList',$param); 32 return Yohobuy::jsonPost(Yohobuy::YOHOBUY_ORDER.'orderInfo/getOrderList',$param);
35 } 33 }
36 34
@@ -24,23 +24,21 @@ class HomeController extends AbstractAction @@ -24,23 +24,21 @@ class HomeController extends AbstractAction
24 /** 24 /**
25 * 初始化 25 * 初始化
26 */ 26 */
27 - public function init()  
28 - { 27 + public function init() {
29 // 检查用户是否登录, 未登录则跳转到登录页 28 // 检查用户是否登录, 未登录则跳转到登录页
30 $this->_uid = $this->getUid(false); 29 $this->_uid = $this->getUid(false);
31 $action = $this->getRequest()->getActionName(); 30 $action = $this->getRequest()->getActionName();
32 if (!$this->_uid && $action !== 'index') { 31 if (!$this->_uid && $action !== 'index') {
33 $this->go(Helpers::url('/signin.html')); 32 $this->go(Helpers::url('/signin.html'));
34 } 33 }
35 - 34 +
36 parent::init(); 35 parent::init();
37 } 36 }
38 37
39 /** 38 /**
40 * 个人中心入口 39 * 个人中心入口
41 */ 40 */
42 - public function indexAction()  
43 - { 41 + public function indexAction() {
44 // 设置网站标题 42 // 设置网站标题
45 $this->setTitle('个人中心'); 43 $this->setTitle('个人中心');
46 $this->setNavHeader('个人中心'); 44 $this->setNavHeader('个人中心');
@@ -65,8 +63,7 @@ class HomeController extends AbstractAction @@ -65,8 +63,7 @@ class HomeController extends AbstractAction
65 /** 63 /**
66 * 用户收藏的商品 64 * 用户收藏的商品
67 */ 65 */
68 - public function favoriteAction()  
69 - { 66 + public function favoriteAction() {
70 // 设置网站标题 67 // 设置网站标题
71 $this->setTitle('我的收藏'); 68 $this->setTitle('我的收藏');
72 $this->setNavHeader('我的收藏', true, SITE_MAIN); 69 $this->setNavHeader('我的收藏', true, SITE_MAIN);
@@ -81,9 +78,9 @@ class HomeController extends AbstractAction @@ -81,9 +78,9 @@ class HomeController extends AbstractAction
81 'pageFooter' => true, 78 'pageFooter' => true,
82 'favorite' => true, 79 'favorite' => true,
83 'hasFavProduct' => $favProducts, 80 'hasFavProduct' => $favProducts,
84 - 'productUrl' => '/product/new', 81 + 'productUrl' => '/product/new',
85 'hasFavBrand' => $favBrands, 82 'hasFavBrand' => $favBrands,
86 - 'brandUrl' => '/product/new' 83 + 'brandUrl' => '/product/new'
87 ); 84 );
88 // 判断是否为品牌收藏页 85 // 判断是否为品牌收藏页
89 if ($tab === 'brand') { 86 if ($tab === 'brand') {
@@ -96,8 +93,7 @@ class HomeController extends AbstractAction @@ -96,8 +93,7 @@ class HomeController extends AbstractAction
96 /** 93 /**
97 * 用户收藏的商品-删除 94 * 用户收藏的商品-删除
98 */ 95 */
99 - public function favoriteDelAction()  
100 - { 96 + public function favoriteDelAction() {
101 $result = array(); 97 $result = array();
102 98
103 if ($this->isAjax()) { 99 if ($this->isAjax()) {
@@ -117,8 +113,7 @@ class HomeController extends AbstractAction @@ -117,8 +113,7 @@ class HomeController extends AbstractAction
117 /** 113 /**
118 * 个人信息 114 * 个人信息
119 */ 115 */
120 - public function personalDetailsAction()  
121 - { 116 + public function personalDetailsAction() {
122 $this->setTitle('个人信息'); 117 $this->setTitle('个人信息');
123 $this->setNavHeader('个人信息', true, SITE_MAIN); 118 $this->setNavHeader('个人信息', true, SITE_MAIN);
124 119
@@ -132,8 +127,7 @@ class HomeController extends AbstractAction @@ -132,8 +127,7 @@ class HomeController extends AbstractAction
132 /** 127 /**
133 * YOHO币 128 * YOHO币
134 */ 129 */
135 - public function currencyAction()  
136 - { 130 + public function currencyAction() {
137 $this->setTitle('YOHO币'); 131 $this->setTitle('YOHO币');
138 $this->setNavHeader('YOHO币', true, false); 132 $this->setNavHeader('YOHO币', true, false);
139 133
@@ -147,8 +141,7 @@ class HomeController extends AbstractAction @@ -147,8 +141,7 @@ class HomeController extends AbstractAction
147 /** 141 /**
148 * 优惠券 142 * 优惠券
149 */ 143 */
150 - public function couponsAction()  
151 - { 144 + public function couponsAction() {
152 $this->setTitle('优惠券'); 145 $this->setTitle('优惠券');
153 $this->setNavHeader('优惠券', true, SITE_MAIN); 146 $this->setNavHeader('优惠券', true, SITE_MAIN);
154 147
@@ -168,8 +161,7 @@ class HomeController extends AbstractAction @@ -168,8 +161,7 @@ class HomeController extends AbstractAction
168 /** 161 /**
169 * 我的消息 162 * 我的消息
170 */ 163 */
171 - public function messageAction()  
172 - { 164 + public function messageAction() {
173 $uid = $this->getUid(); 165 $uid = $this->getUid();
174 $page = $this->get('page', 0); 166 $page = $this->get('page', 0);
175 $size = $this->get('size', 10); 167 $size = $this->get('size', 10);
@@ -182,8 +174,7 @@ class HomeController extends AbstractAction @@ -182,8 +174,7 @@ class HomeController extends AbstractAction
182 /** 174 /**
183 * 地址管理 175 * 地址管理
184 */ 176 */
185 - public function addressAction()  
186 - { 177 + public function addressAction() {
187 // 设置网站标题 178 // 设置网站标题
188 $this->setTitle('地址管理'); 179 $this->setTitle('地址管理');
189 $this->setNavHeader('地址管理'); 180 $this->setNavHeader('地址管理');
@@ -203,8 +194,7 @@ class HomeController extends AbstractAction @@ -203,8 +194,7 @@ class HomeController extends AbstractAction
203 /** 194 /**
204 * 修改地址或者添加新地址 195 * 修改地址或者添加新地址
205 */ 196 */
206 - public function saveAddressAction()  
207 - { 197 + public function saveAddressAction() {
208 $result = array(); 198 $result = array();
209 199
210 if ($this->isAjax()) { 200 if ($this->isAjax()) {
@@ -230,8 +220,7 @@ class HomeController extends AbstractAction @@ -230,8 +220,7 @@ class HomeController extends AbstractAction
230 /** 220 /**
231 * 设置默认地址 221 * 设置默认地址
232 */ 222 */
233 - public function defaultAddressAction()  
234 - { 223 + public function defaultAddressAction() {
235 $result = array(); 224 $result = array();
236 225
237 if ($this->isAjax()) { 226 if ($this->isAjax()) {
@@ -250,8 +239,7 @@ class HomeController extends AbstractAction @@ -250,8 +239,7 @@ class HomeController extends AbstractAction
250 /** 239 /**
251 * 删除地址 240 * 删除地址
252 */ 241 */
253 - public function delAddressAction()  
254 - { 242 + public function delAddressAction() {
255 $result = array(); 243 $result = array();
256 244
257 if ($this->isAjax()) { 245 if ($this->isAjax()) {
@@ -269,8 +257,7 @@ class HomeController extends AbstractAction @@ -269,8 +257,7 @@ class HomeController extends AbstractAction
269 } 257 }
270 258
271 //在线客服 259 //在线客服
272 - public function onlineServiceAction()  
273 - { 260 + public function onlineServiceAction() {
274 // 设置网站标题 261 // 设置网站标题
275 $this->setTitle('在线客服'); 262 $this->setTitle('在线客服');
276 $this->setNavHeader('在线客服', true, SITE_MAIN); 263 $this->setNavHeader('在线客服', true, SITE_MAIN);
@@ -285,8 +272,7 @@ class HomeController extends AbstractAction @@ -285,8 +272,7 @@ class HomeController extends AbstractAction
285 } 272 }
286 273
287 //在线客服-具体详情 274 //在线客服-具体详情
288 - public function onlineServiceDetailAction()  
289 - { 275 + public function onlineServiceDetailAction() {
290 $service = array(); 276 $service = array();
291 $cateId = $this->get('cateId', 0); 277 $cateId = $this->get('cateId', 0);
292 $cateName = $this->get('cateName', ''); 278 $cateName = $this->get('cateName', '');
@@ -301,8 +287,7 @@ class HomeController extends AbstractAction @@ -301,8 +287,7 @@ class HomeController extends AbstractAction
301 /** 287 /**
302 * 我的逛 288 * 我的逛
303 */ 289 */
304 - public function myGuangAction()  
305 - { 290 + public function myGuangAction() {
306 $page = $this->get('page', 1); 291 $page = $this->get('page', 1);
307 $limit = $this->get('limit', 10); 292 $limit = $this->get('limit', 10);
308 $uid = $this->getUid(); 293 $uid = $this->getUid();
@@ -325,8 +310,7 @@ class HomeController extends AbstractAction @@ -325,8 +310,7 @@ class HomeController extends AbstractAction
325 /** 310 /**
326 * 意见反馈 311 * 意见反馈
327 */ 312 */
328 - public function suggestAction()  
329 - { 313 + public function suggestAction() {
330 // 设置网站标题 314 // 设置网站标题
331 $this->setTitle('意见反馈'); 315 $this->setTitle('意见反馈');
332 $this->setNavHeader('意见反馈', true, SITE_MAIN); 316 $this->setNavHeader('意见反馈', true, SITE_MAIN);
@@ -348,8 +332,7 @@ class HomeController extends AbstractAction @@ -348,8 +332,7 @@ class HomeController extends AbstractAction
348 /** 332 /**
349 * 意见反馈-提交表单页面 333 * 意见反馈-提交表单页面
350 */ 334 */
351 - public function suggestSubAction()  
352 - { 335 + public function suggestSubAction() {
353 // 设置网站标题 336 // 设置网站标题
354 $this->setTitle('反馈问题'); 337 $this->setTitle('反馈问题');
355 338
@@ -370,8 +353,7 @@ class HomeController extends AbstractAction @@ -370,8 +353,7 @@ class HomeController extends AbstractAction
370 /** 353 /**
371 * 异步上传图片 354 * 异步上传图片
372 */ 355 */
373 - public function suggestimgUploadAction()  
374 - { 356 + public function suggestimgUploadAction() {
375 //$filename = $this->post('filename', ''); 357 //$filename = $this->post('filename', '');
376 $result = UserModel::saveSuggestImg('fileData'); 358 $result = UserModel::saveSuggestImg('fileData');
377 359
@@ -381,8 +363,7 @@ class HomeController extends AbstractAction @@ -381,8 +363,7 @@ class HomeController extends AbstractAction
381 /** 363 /**
382 * 异步保存意见反馈数据 364 * 异步保存意见反馈数据
383 */ 365 */
384 - public function savesuggestAction()  
385 - { 366 + public function savesuggestAction() {
386 if ($this->isAjax()) { 367 if ($this->isAjax()) {
387 $uid = $this->getUid(); 368 $uid = $this->getUid();
388 $content = $this->post('content', ''); 369 $content = $this->post('content', '');
@@ -397,8 +378,7 @@ class HomeController extends AbstractAction @@ -397,8 +378,7 @@ class HomeController extends AbstractAction
397 /** 378 /**
398 * 异步点击靠谱或者不靠谱 379 * 异步点击靠谱或者不靠谱
399 */ 380 */
400 - public function upAndDownAction()  
401 - { 381 + public function upAndDownAction() {
402 if ($this->isAjax()) { 382 if ($this->isAjax()) {
403 $uid = $this->getUid(); 383 $uid = $this->getUid();
404 $udid = $this->getUdid(); 384 $udid = $this->getUdid();
@@ -412,8 +392,7 @@ class HomeController extends AbstractAction @@ -412,8 +392,7 @@ class HomeController extends AbstractAction
412 /** 392 /**
413 * 会员等级展示页 393 * 会员等级展示页
414 */ 394 */
415 - public function gradeAction()  
416 - { 395 + public function gradeAction() {
417 //设置网站seo信息 396 //设置网站seo信息
418 $this->setTitle('会员等级'); 397 $this->setTitle('会员等级');
419 //显示网站导航头部信息 398 //显示网站导航头部信息
@@ -428,23 +407,23 @@ class HomeController extends AbstractAction @@ -428,23 +407,23 @@ class HomeController extends AbstractAction
428 /* 407 /*
429 * 会员特权查看页 408 * 会员特权查看页
430 */ 409 */
431 - public function preferentialAction()  
432 - { 410 +
  411 + public function preferentialAction() {
433 //设置网站seo信息 412 //设置网站seo信息
434 $this->setTitle('会员等级'); 413 $this->setTitle('会员等级');
435 //显示网站导航头部信息 414 //显示网站导航头部信息
436 $this->setNavHeader('会员特权详情'); 415 $this->setNavHeader('会员特权详情');
437 $data = GradeModel::getPreferential(); 416 $data = GradeModel::getPreferential();
438 $data['pageFooter'] = true; 417 $data['pageFooter'] = true;
439 - 418 +
440 $this->_view->display('privilege', $data); 419 $this->_view->display('privilege', $data);
441 } 420 }
442 421
443 /* 422 /*
444 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders) 423 * 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
445 */ 424 */
446 - public function orderAction()  
447 - { 425 +
  426 + public function orderAction() {
448 //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。 427 //获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论。
449 $type = $this->get('type', 1); 428 $type = $this->get('type', 1);
450 $this->setTitle('我的订单'); 429 $this->setTitle('我的订单');
@@ -464,17 +443,17 @@ class HomeController extends AbstractAction @@ -464,17 +443,17 @@ class HomeController extends AbstractAction
464 } 443 }
465 444
466 //ajax请求订单页面 445 //ajax请求订单页面
467 - public function getOrdersAction()  
468 - { 446 + public function getOrdersAction() {
469 //判断是不是ajax请求 447 //判断是不是ajax请求
470 if (!$this->isAjax()) { 448 if (!$this->isAjax()) {
471 $this->error(); 449 $this->error();
472 } 450 }
473 - //获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论 451 + //获取基本参数:type 1:全部 2:待付款 3:待发货 4:待收货 5:待评论 7:失败 取消 订单
474 $type = $this->get('type', 1); 452 $type = $this->get('type', 1);
475 $page = $this->get('page', 1); 453 $page = $this->get('page', 1);
476 $limit = $this->get('limit', 10); 454 $limit = $this->get('limit', 10);
477 $uid = $this->getUid(); 455 $uid = $this->getUid();
  456 + $uid = '12';//测试数据
478 //调用模型层getOrder方法获得并处理数据 457 //调用模型层getOrder方法获得并处理数据
479 $data = OrderModel::getOrder($type, $page, $limit, $uid); 458 $data = OrderModel::getOrder($type, $page, $limit, $uid);
480 /* 如果取不到订单数据时,分两种情况: 459 /* 如果取不到订单数据时,分两种情况:
@@ -499,8 +478,7 @@ class HomeController extends AbstractAction @@ -499,8 +478,7 @@ class HomeController extends AbstractAction
499 * 我的订单-取消订单 478 * 我的订单-取消订单
500 */ 479 */
501 480
502 - public function cancelOrderAction()  
503 - { 481 + public function cancelOrderAction() {
504 482
505 //判断是不是ajax请求 483 //判断是不是ajax请求
506 if (!$this->isAjax()) { 484 if (!$this->isAjax()) {
@@ -522,8 +500,7 @@ class HomeController extends AbstractAction @@ -522,8 +500,7 @@ class HomeController extends AbstractAction
522 * 我的订单-删除订单 500 * 我的订单-删除订单
523 */ 501 */
524 502
525 - public function delOrderAction()  
526 - { 503 + public function delOrderAction() {
527 //判断是不是ajax请求 504 //判断是不是ajax请求
528 if (!$this->isAjax()) { 505 if (!$this->isAjax()) {
529 $this->error(); 506 $this->error();
@@ -544,8 +521,7 @@ class HomeController extends AbstractAction @@ -544,8 +521,7 @@ class HomeController extends AbstractAction
544 * 我的订单-支付链接获取 521 * 我的订单-支付链接获取
545 */ 522 */
546 523
547 - private function paymentAction()  
548 - { 524 + private function paymentAction() {
549 $gender = Helpers::getGenderByCookie(); 525 $gender = Helpers::getGenderByCookie();
550 $yh_channel = $this->get('yh_channel', 1); 526 $yh_channel = $this->get('yh_channel', 1);
551 OrderModel::payment($gender, $yh_channel); 527 OrderModel::payment($gender, $yh_channel);
@@ -555,8 +531,7 @@ class HomeController extends AbstractAction @@ -555,8 +531,7 @@ class HomeController extends AbstractAction
555 * 我的订单-随便逛逛链接获取 531 * 我的订单-随便逛逛链接获取
556 */ 532 */
557 533
558 - private function strollAction()  
559 - { 534 + private function strollAction() {
560 //获取性别、频道数据 535 //获取性别、频道数据
561 $gender = Helpers::getGenderByCookie(); 536 $gender = Helpers::getGenderByCookie();
562 $yh_channel = $this->get('yh_channel', 1); 537 $yh_channel = $this->get('yh_channel', 1);
@@ -568,8 +543,7 @@ class HomeController extends AbstractAction @@ -568,8 +543,7 @@ class HomeController extends AbstractAction
568 /** 543 /**
569 * 订单详情页 544 * 订单详情页
570 */ 545 */
571 - public function orderDetailAction()  
572 - { 546 + public function orderDetailAction() {
573 $data = array( 547 $data = array(
574 'name' => '毛毛莉Lydia', 548 'name' => '毛毛莉Lydia',
575 'phoneNum' => '18600001133', 549 'phoneNum' => '18600001133',
@@ -40,28 +40,73 @@ class OrderModel @@ -40,28 +40,73 @@ class OrderModel
40 } 40 }
41 //调用接口获得数据 41 //调用接口获得数据
42 $data = OrderData::getOrderData($type, $page, $limit, $uid); 42 $data = OrderData::getOrderData($type, $page, $limit, $uid);
43 - print_r($data);  
44 //检查数据返回是否正常,正常则处理数据 43 //检查数据返回是否正常,正常则处理数据
45 if (!empty($data[0])) { 44 if (!empty($data[0])) {
46 $result = array(); 45 $result = array();
47 - foreach($data as $key => $vo){  
48 - $result[$key]['detailUrl'] = $vo[''];  
49 - $result[$key]['orderNum'] = $vo['orderCode'];  
50 - $result[$key]['orderStatus'] = $vo['status'];  
51 - $result[$key]['count'] = count($vo['ordersGoodsList']);  
52 - $result[$key]['sumCost'] = $vo['amount'];  
53 - $result[$key]['sumCost'] = $vo['amount'];  
54 - switch ($vo['status']) {  
55 - case 1:  
56 - $result[$key]['sumCost'] = $vo['amount'];  
57 -  
58 - break;  
59 -  
60 - default:  
61 - break;  
62 - }  
63 - $result[$key]['sumCost'] = $vo['amount'];  
64 - } 46 + foreach ($data as $key => $vo) {
  47 + if (empty($vo['ordersGoodsList'])) {
  48 + break;
  49 + }
  50 + $result[$key]['goods'] = self::formatOrderGoods($vo['ordersGoodsList']);
  51 + $result[$key]['detailUrl'] = '???';
  52 + $result[$key]['orderNum'] = $vo['orderCode'];
  53 + $result[$key]['count'] = count($vo['ordersGoodsList']);
  54 + $result[$key]['sumCost'] = $vo['goodsTotalAmount'];
  55 + do {
  56 + if ($vo['isCancel'] === 'Y') {
  57 + $result[$key]['canceled'] = true;
  58 + $result[$key]['orderStatus'] = '已取消';
  59 + break;
  60 + }
  61 + if ($vo['paymentType'] != 2) {
  62 + switch ($vo['ordersStatus']) {
  63 + case 0:
  64 + $result[$key]['unpaid'] = true;
  65 + $result[$key]['orderStatus'] = '待付款';
  66 + break;
  67 + //未发货&未收货 状态,统一合并到待收货状态。
  68 + case 1:
  69 + case 2:
  70 + case 3:
  71 + $result[$key]['orderStatus'] = '已付款';
  72 + $result[$key]['unreceived'] = true;
  73 + break;
  74 + case 4:
  75 + case 5:
  76 + $result[$key]['orderStatus'] = '已发货';
  77 + $result[$key]['unreceived'] = true;
  78 + //待收货状态,给查看物流url
  79 + $result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
  80 + break;
  81 + case 6:
  82 + $result[$key]['orderStatus'] = '交易成功';
  83 + $result[$key]['completed'] = true;
  84 + break;
  85 + default:
  86 + break;
  87 + }
  88 + } elseif ($vo['paymentType'] == 2) {
  89 + switch ($vo['ordersStatus']) {
  90 + case 0:
  91 + case 1:
  92 + case 2:
  93 + case 3:
  94 + case 4:
  95 + case 5:
  96 + $result[$key]['orderStatus'] = '备货中';
  97 + $result[$key]['unreceived'] = true;
  98 + //待收货状态,给查看物流url
  99 + $result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
  100 + break;
  101 + case 6:
  102 + $result[$key]['completed'] = true;
  103 + break;
  104 + default:
  105 + break;
  106 + }
  107 + }
  108 + } while (false);
  109 + }
65 } 110 }
66 111
67 if (USE_CACHE) { 112 if (USE_CACHE) {
@@ -78,20 +123,33 @@ class OrderModel @@ -78,20 +123,33 @@ class OrderModel
78 } 123 }
79 124
80 //格式化订单商品 125 //格式化订单商品
81 - static function formatOrderGoods($orderGoods) { 126 + static function formatOrderGoods($ordersGoodsList) {
82 $arr = array(); 127 $arr = array();
83 - foreach ($orderGoods as $key => $vo) {  
84 - $arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);  
85 - $arr[$key]['name'] = $vo['product_name'];  
86 - $arr[$key]['color'] = $vo['color_name'];  
87 - $arr[$key]['size'] = $vo['size_name'];  
88 - $arr[$key]['price'] = $vo['goods_price'];  
89 - $arr[$key]['count'] = $vo['buy_number']; 128 + foreach ($ordersGoodsList as $key => $vo) {
  129 + $arr[$key]['thumb'] = Helpers::getImageUrl($vo['goodsImg'][0]['imageUrl'], 90, 120);
  130 + $arr[$key]['name'] = $vo['goodsName'];
  131 + $arr[$key]['color'] = $vo['colorName'];
  132 + $arr[$key]['size'] = $vo['sizeName'];
  133 + $arr[$key]['price'] = $vo['goodsPrice'];
  134 + $arr[$key]['count'] = $vo['num'];
90 //gift=>是否赠品,advanceBuy=>是否加价购; 135 //gift=>是否赠品,advanceBuy=>是否加价购;
91 - if ($vo['goods_type'] == 'gift') {  
92 - $arr[$key]['gift'] = true;  
93 - } elseif ($vo['goods_type'] == 'price_gift') {  
94 - $arr[$key]['advanceBuy'] = true; 136 + switch ($vo['goodsType']) {
  137 + case 1://普通商品
  138 + break;
  139 + case 2://商品的赠品
  140 + $arr[$key]['gift'] = true;
  141 + break;
  142 + case 3://订单的赠品
  143 + $arr[$key]['gift'] = true;
  144 + break;
  145 + case 4://商品满足条件加钱送
  146 + $arr[$key]['advanceBuy'] = true;
  147 + break;
  148 + case 5://订单满足条件价钱送
  149 + $arr[$key]['advanceBuy'] = true;
  150 + break;
  151 + default:
  152 + break;
95 } 153 }
96 } 154 }
97 return $arr; 155 return $arr;