Authored by hf

do fixes bug to home order bugs

@@ -515,4 +515,32 @@ class Helpers @@ -515,4 +515,32 @@ class Helpers
515 return $arr; 515 return $arr;
516 } 516 }
517 517
  518 + /**
  519 + * 获取会员的级别
  520 + *
  521 + * @param string $vipInfo
  522 + * @return int
  523 + */
  524 + public static function getVipLevel($vipInfo)
  525 + {
  526 + $vipLevel = 0;
  527 +
  528 + switch ($vipInfo) {
  529 + case '普通会员':
  530 + $vipLevel = 0;
  531 + break;
  532 + case '银卡会员':
  533 + $vipLevel = 1;
  534 + break;
  535 + case '金卡会员':
  536 + $vipLevel = 2;
  537 + break;
  538 + case '白金会员':
  539 + $vipLevel = 3;
  540 + break;
  541 + }
  542 +
  543 + return $vipLevel;
  544 + }
  545 +
518 } 546 }
@@ -23,7 +23,7 @@ class OrderModel @@ -23,7 +23,7 @@ class OrderModel
23 { 23 {
24 $result = array(); 24 $result = array();
25 //调用接口获得数据 25 //调用接口获得数据
26 - $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 7394907); 26 + $data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
27 // 判断是否还有数据, 没有数据则返回空 27 // 判断是否还有数据, 没有数据则返回空
28 if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) { 28 if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
29 return $result; 29 return $result;
@@ -25,13 +25,13 @@ class DetailModel @@ -25,13 +25,13 @@ class DetailModel
25 * @param int $uid 当前登录用户ID, 未登录为0 25 * @param int $uid 当前登录用户ID, 未登录为0
26 * @return array 26 * @return array
27 */ 27 */
28 - public static function getBaseInfo($productId, $goodsId, $uid) 28 + public static function getBaseInfo($productId, $goodsId, $uid, $vipLevel)
29 { 29 {
30 $result = array(); 30 $result = array();
31 31
32 if (is_numeric($productId) && is_numeric($goodsId)) { 32 if (is_numeric($productId) && is_numeric($goodsId)) {
33 // 调用服务 33 // 调用服务
34 - $baseInfo = DetailData::baseInfo($productId, $uid); var_dump($baseInfo); 34 + $baseInfo = DetailData::baseInfo($productId, $uid);
35 35
36 // 判断商品是否在架 36 // 判断商品是否在架
37 if (empty($baseInfo['status'])) { 37 if (empty($baseInfo['status'])) {
@@ -42,6 +42,11 @@ class DetailModel @@ -42,6 +42,11 @@ class DetailModel
42 if (isset($baseInfo['productName'])) { 42 if (isset($baseInfo['productName'])) {
43 $result['goodsName'] = $baseInfo['productName']; 43 $result['goodsName'] = $baseInfo['productName'];
44 } 44 }
  45 +
  46 + // 商品促销短语
  47 + if (!empty($baseInfo['salesPhrase'])) {
  48 + $result['goodsSubtitle'] = $baseInfo['salesPhrase'];
  49 + }
45 50
46 // 商品标签 51 // 商品标签
47 if (!empty($baseInfo['productTagBoList'])) { 52 if (!empty($baseInfo['productTagBoList'])) {
@@ -83,7 +88,7 @@ class DetailModel @@ -83,7 +88,7 @@ class DetailModel
83 foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) { 88 foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
84 $build['level'] = $value['vipLevel']; 89 $build['level'] = $value['vipLevel'];
85 $build['text'] = $value['vipPrice']; 90 $build['text'] = $value['vipPrice'];
86 - $build['currentLevel'] = false; 91 + $build['currentLevel'] = ($value['vipLevel'] == $vipLevel) ? true : false;
87 $result['vipLevel']['list'][] = $build; 92 $result['vipLevel']['list'][] = $build;
88 } 93 }
89 } 94 }
  1 +D:\workspace\yohobuy.git.dev.yoho.cn\yohobuy\m.yohobuy.com\application\modules\Product\controllers\Detail.php