Authored by hf

do fixes bug to product detail page

@@ -99,14 +99,13 @@ class NewsaleData @@ -99,14 +99,13 @@ class NewsaleData
99 $param['method'] = 'app.search.newProduct'; 99 $param['method'] = 'app.search.newProduct';
100 } else { 100 } else {
101 $param['method'] = 'app.search.sales'; 101 $param['method'] = 'app.search.sales';
102 - $param['p_d'] = '0.1,0.9'; 102 + $param['p_d'] = '0.1,0.9';
103 } 103 }
104 $param['page'] = $page; 104 $param['page'] = $page;
105 $param['limit'] = $limit; 105 $param['limit'] = $limit;
106 $param['order'] = $order; 106 $param['order'] = $order;
107 $param['yh_channel'] = $channel; 107 $param['yh_channel'] = $channel;
108 $param = array_merge($param, $queriedParams); 108 $param = array_merge($param, $queriedParams);
109 -  
110 $param['client_secret'] = Sign::getSign($param); 109 $param['client_secret'] = Sign::getSign($param);
111 110
112 return Yohobuy::get(Yohobuy::API_URL, $param, 600); // 缓存10分钟 111 return Yohobuy::get(Yohobuy::API_URL, $param, 600); // 缓存10分钟
@@ -508,6 +508,7 @@ class Helpers @@ -508,6 +508,7 @@ class Helpers
508 } elseif ($vo['goods_type'] == 'price_gift') { 508 } elseif ($vo['goods_type'] == 'price_gift') {
509 $arr[$key]['advanceBuy'] = true; 509 $arr[$key]['advanceBuy'] = true;
510 } 510 }
  511 + // 上市期
511 if (!empty($vo['expect_arrival_time'])) { 512 if (!empty($vo['expect_arrival_time'])) {
512 $arr[$key]['appearDate'] = $vo['expect_arrival_time']; 513 $arr[$key]['appearDate'] = $vo['expect_arrival_time'];
513 } 514 }
@@ -36,26 +36,26 @@ @@ -36,26 +36,26 @@
36 <div class="my-order"> 36 <div class="my-order">
37 <div class="order-title"> 37 <div class="order-title">
38 我的订单 38 我的订单
39 - <a class="iconfont" href="/home/order"> 39 + <a class="iconfont" href="/home/orders">
40 查看全部订单 &#xe604; 40 查看全部订单 &#xe604;
41 </a> 41 </a>
42 </div> 42 </div>
43 <div class="order-type clearfix"> 43 <div class="order-type clearfix">
44 - <a class="type-item" href="/home/order?type=2"> 44 + <a class="type-item" href="/home/orders?type=2">
45 <span class="iconfont">&#xe634;</span> 45 <span class="iconfont">&#xe634;</span>
46 <br>待付款 46 <br>待付款
47 {{#if wait_pay_num}} 47 {{#if wait_pay_num}}
48 <span class="num">{{wait_pay_num}}</span> 48 <span class="num">{{wait_pay_num}}</span>
49 {{/if}} 49 {{/if}}
50 </a> 50 </a>
51 - <a class="type-item" href="/home/order?type=3"> 51 + <a class="type-item" href="/home/orders?type=3">
52 <span class="iconfont">&#xe63b;</span> 52 <span class="iconfont">&#xe63b;</span>
53 <br>待发货 53 <br>待发货
54 {{#if wait_cargo_num}} 54 {{#if wait_cargo_num}}
55 <span class="num">{{wait_cargo_num}}</span> 55 <span class="num">{{wait_cargo_num}}</span>
56 {{/if}} 56 {{/if}}
57 </a> 57 </a>
58 - <a class="type-item" href="/home/order?type=4"> 58 + <a class="type-item" href="/home/orders?type=4">
59 <span class="iconfont">&#xe633;</span> 59 <span class="iconfont">&#xe633;</span>
60 <br>待收货 60 <br>待收货
61 {{#if send_cargo_num}} 61 {{#if send_cargo_num}}
@@ -24,9 +24,6 @@ class ErrorController extends AbstractAction @@ -24,9 +24,6 @@ class ErrorController extends AbstractAction
24 header('HTTP/1.1 404 Not Found'); 24 header('HTTP/1.1 404 Not Found');
25 header('Status: 404 Not Found'); 25 header('Status: 404 Not Found');
26 26
27 - // @todo debug  
28 - //echo $exception->getMessage();  
29 -  
30 // 设置网站标题 27 // 设置网站标题
31 $this->setTitle('页面不存在'); 28 $this->setTitle('页面不存在');
32 $this->setNavHeader('抱歉,页面不存在!', true, SITE_MAIN); 29 $this->setNavHeader('抱歉,页面不存在!', true, SITE_MAIN);
@@ -636,7 +636,7 @@ class HomeController extends AbstractAction @@ -636,7 +636,7 @@ class HomeController extends AbstractAction
636 * 636 *
637 */ 637 */
638 638
639 - public function orderAction() 639 + public function ordersAction()
640 { 640 {
641 // 审判跳转登录页 641 // 审判跳转登录页
642 $this->auditJumpLogin(); 642 $this->auditJumpLogin();
@@ -95,7 +95,7 @@ class DetailModel @@ -95,7 +95,7 @@ class DetailModel
95 95
96 // 上市期 96 // 上市期
97 if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) { 97 if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
98 - $result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月'; 98 + $result['periodOfMarket'] = $baseInfo['expectArrivalTime'] . '月';
99 } 99 }
100 100
101 // 促销信息 101 // 促销信息
@@ -103,7 +103,6 @@ class DetailModel @@ -103,7 +103,6 @@ class DetailModel
103 $build = array(); 103 $build = array();
104 foreach ($baseInfo['promotionBoList'] as $value) { 104 foreach ($baseInfo['promotionBoList'] as $value) {
105 $build['text'] = $value['promotionTitle']; 105 $build['text'] = $value['promotionTitle'];
106 - //$build['type'] = $value['promotionType'];  
107 $result['goodsDiscount']['list'][] = $build; 106 $result['goodsDiscount']['list'][] = $build;
108 } 107 }
109 } 108 }
@@ -138,7 +137,7 @@ class DetailModel @@ -138,7 +137,7 @@ class DetailModel
138 foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) { 137 foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
139 $build['userName'] = $value['nickName']; 138 $build['userName'] = $value['nickName'];
140 $build['desc'] = $value['colorName'] . '/' . $value['sizeName']; 139 $build['desc'] = $value['colorName'] . '/' . $value['sizeName'];
141 - $build['content'] = $value['content']; 140 + $build['content'] = isset($value['content']) ? $value['content'] : '';
142 $build['time'] = $value['createTime']; 141 $build['time'] = $value['createTime'];
143 $result['feedbacks']['comments'][] = $build; 142 $result['feedbacks']['comments'][] = $build;
144 } 143 }
@@ -286,7 +285,24 @@ class DetailModel @@ -286,7 +285,24 @@ class DetailModel
286 'enTitle' => 'SIZE INFO', 285 'enTitle' => 'SIZE INFO',
287 'detail' => array('list' => array()), 286 'detail' => array('list' => array()),
288 ); 287 );
  288 + /* 参考尺码 */
  289 + $boyReference = !empty($sizeInfo['productExtra']['boyReference']);
  290 + $girlReference = !empty($sizeInfo['productExtra']['girlReference']);
  291 + $gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3;
  292 + $referenceName = '参考尺码';
  293 + if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference) ) {
  294 + $referenceName = '参考尺码';
  295 + }
  296 + elseif ($gender == 3 && $boyReference) {
  297 + $referenceName = '参考尺码(男)';
  298 + }
  299 + elseif ($gender == 3 && $girlReference) {
  300 + $referenceName = '参考尺码(女)';
  301 + }
  302 +
  303 + $showReference = false;
289 $sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称 304 $sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
  305 + $referenceList = array();
290 $sizeBoGroup = array(); // 尺码按ID分组 306 $sizeBoGroup = array(); // 尺码按ID分组
291 foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) { 307 foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
292 $sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']); 308 $sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']);
@@ -464,8 +480,8 @@ class DetailModel @@ -464,8 +480,8 @@ class DetailModel
464 480
465 if (is_numeric($productSkn)) { 481 if (is_numeric($productSkn)) {
466 $preference = DetailData::preference($productSkn, $channel, $brandId); 482 $preference = DetailData::preference($productSkn, $channel, $brandId);
467 - if (!empty($preference['data'])) {  
468 - foreach ($preference['data'] as $value) { 483 + if (!empty($preference)) {
  484 + foreach ($preference as $value) {
469 $result['recommendList'][] = Helpers::formatProduct($value, false, true, true, 299, 388, false, false); 485 $result['recommendList'][] = Helpers::formatProduct($value, false, true, true, 299, 388, false, false);
470 } 486 }
471 } 487 }
@@ -225,11 +225,10 @@ class LoginController extends AbstractAction @@ -225,11 +225,10 @@ class LoginController extends AbstractAction
225 { 225 {
226 $sina = Factory::create('sinaweibo'); 226 $sina = Factory::create('sinaweibo');
227 $access = $sina->getAccessToken(); 227 $access = $sina->getAccessToken();
228 - /* 获取QQ腾讯用户的详细信息 */ 228 + /* 获取用户的详细信息 */
229 $partnerInfo = $sina->getUserInfo($access); 229 $partnerInfo = $sina->getUserInfo($access);
230 230
231 $result = array(); 231 $result = array();
232 -  
233 if ($partnerInfo && is_array($partnerInfo)) { 232 if ($partnerInfo && is_array($partnerInfo)) {
234 $result = LoginData::signinByOpenID($partnerInfo['screen_name'], $access['uid'], 'sina'); 233 $result = LoginData::signinByOpenID($partnerInfo['screen_name'], $access['uid'], 'sina');
235 } 234 }
@@ -124,7 +124,7 @@ class DetailController extends AbstractAction @@ -124,7 +124,7 @@ class DetailController extends AbstractAction
124 'consults' => array( 124 'consults' => array(
125 'list' => \Product\DetailModel::getConsults($productId), 125 'list' => \Product\DetailModel::getConsults($productId),
126 ), 126 ),
127 - 'consultUrl' => Helpers::url('/product/detail/consultform'), 127 + 'link' => Helpers::url('/product/detail/consultform', array('product_id' => $productId)),
128 ); 128 );
129 129
130 // 渲染模板 130 // 渲染模板
@@ -186,7 +186,7 @@ class DetailController extends AbstractAction @@ -186,7 +186,7 @@ class DetailController extends AbstractAction
186 $result = array(); 186 $result = array();
187 187
188 if ($this->isAjax()) { 188 if ($this->isAjax()) {
189 - $productSkn = $this->get('productSkn'); // 50000058 189 + $productSkn = $this->get('productSkn');
190 $brandId = $this->get('brandId'); 190 $brandId = $this->get('brandId');
191 $channel = Helpers::getChannelByCookie(); 191 $channel = Helpers::getChannelByCookie();
192 $result = \Product\DetailModel::getPreference($productSkn, $channel, $brandId); 192 $result = \Product\DetailModel::getPreference($productSkn, $channel, $brandId);
@@ -187,7 +187,6 @@ class NewsaleController extends AbstractAction @@ -187,7 +187,6 @@ class NewsaleController extends AbstractAction
187 $order = Helpers::transOrder($orderVal, $type); 187 $order = Helpers::transOrder($orderVal, $type);
188 188
189 $channel = Helpers::getChannelByCookie(); 189 $channel = Helpers::getChannelByCookie();
190 -  
191 $data = NewsaleData::selectNewSaleProducts( 190 $data = NewsaleData::selectNewSaleProducts(
192 $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order 191 $gender, $brand, $sort, $color, $size, $price, $p_d, $channel, $dayLimit, $limit, $page, $order
193 ); 192 );