Authored by hf

do fixes bug to home order bugs

... ... @@ -515,4 +515,32 @@ class Helpers
return $arr;
}
/**
* 获取会员的级别
*
* @param string $vipInfo
* @return int
*/
public static function getVipLevel($vipInfo)
{
$vipLevel = 0;
switch ($vipInfo) {
case '普通会员':
$vipLevel = 0;
break;
case '银卡会员':
$vipLevel = 1;
break;
case '金卡会员':
$vipLevel = 2;
break;
case '白金会员':
$vipLevel = 3;
break;
}
return $vipLevel;
}
}
... ...
... ... @@ -23,7 +23,7 @@ class OrderModel
{
$result = array();
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, 7394907);
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
... ...
... ... @@ -25,13 +25,13 @@ class DetailModel
* @param int $uid 当前登录用户ID, 未登录为0
* @return array
*/
public static function getBaseInfo($productId, $goodsId, $uid)
public static function getBaseInfo($productId, $goodsId, $uid, $vipLevel)
{
$result = array();
if (is_numeric($productId) && is_numeric($goodsId)) {
// 调用服务
$baseInfo = DetailData::baseInfo($productId, $uid); var_dump($baseInfo);
$baseInfo = DetailData::baseInfo($productId, $uid);
// 判断商品是否在架
if (empty($baseInfo['status'])) {
... ... @@ -42,6 +42,11 @@ class DetailModel
if (isset($baseInfo['productName'])) {
$result['goodsName'] = $baseInfo['productName'];
}
// 商品促销短语
if (!empty($baseInfo['salesPhrase'])) {
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
}
// 商品标签
if (!empty($baseInfo['productTagBoList'])) {
... ... @@ -83,7 +88,7 @@ class DetailModel
foreach ($baseInfo['productPriceBo']['vipPrices'] as $value) {
$build['level'] = $value['vipLevel'];
$build['text'] = $value['vipPrice'];
$build['currentLevel'] = false;
$build['currentLevel'] = ($value['vipLevel'] == $vipLevel) ? true : false;
$result['vipLevel']['list'][] = $build;
}
}
... ...
D:\workspace\yohobuy.git.dev.yoho.cn\yohobuy\m.yohobuy.com\application\modules\Product\controllers\Detail.php
\ No newline at end of file
... ...