Authored by 郭成尧

'申请退换货不做限制问题解决'

... ... @@ -294,6 +294,8 @@ class ReturnsModel
//调用接口,根据订单号获取可退货商品信息
$data = ReturnsData::getRefundGoodsData($orderCode, $uid);
$isLimited = false;
//调用接口成功,封装数据
if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['goods_list']) && !empty($data['data']['goods_list'])) {
$amount = '';
... ... @@ -314,6 +316,13 @@ class ReturnsModel
$result['goods'][$key]['goods_type_id'] = $value['goods_type_id'];
$result['goods'][$key]['goods_type'] = $value['goods_type'];
$amount += $value['last_price'];//所以商品价格加起来,等于订单总价
// tar note 为每个特殊商品都添加标识
if ($value['is_limit_skn'] === 'Y') {
$result['goods'][$key]['specialNoticeBo'] = $data['data']['special_notice'];
$isLimited = true;
}
//商品中有鞋类,传给前端标识
if ($value['hasShoes']) {
$result['tips']['footwear'] = true;
... ... @@ -323,9 +332,9 @@ class ReturnsModel
$result['reason'] = $data['data']['return_reason'];
// tar note 对数组做处理,为不显示的添加 inactive
if (isset($data['data']['special_exchange_reason'])) {
if (isset($data['data']['special_return_reason']) && $isLimited) {
foreach ($result['reason'] as $key => $item) {
if (!in_array($item, $data['data']['special_exchange_reason'])) {
if (!in_array($item, $data['data']['special_return_reason'])) {
$result['reason'][$key]['inactive'] = true;
}
}
... ... @@ -374,6 +383,8 @@ class ReturnsModel
//调用接口,根据订单号获取订单可换货商品信息
$data = ReturnsData::getChangeGoodsData($orderCode, $uid);
$isLimited = false;
$productSkn = array();
//数据获取成功,封装数据
if (isset($data['code']) && $data['code'] == 200 && isset($data['data']) && !empty($data['data'])) {
... ... @@ -396,6 +407,7 @@ class ReturnsModel
// tar note 为每个特殊商品都添加标识
if ($value['is_limit_skn'] === 'Y') {
$result['goods'][$key]['specialNoticeBo'] = $data['data']['specialNoticeBo'];
$isLimited = true;
}
//给前端标识出鞋类
... ... @@ -407,7 +419,7 @@ class ReturnsModel
$result['reason'] = $data['data']['exchange_reason'];
// tar note 对数组做处理,为不显示的添加 inactive
if (isset($data['data']['special_exchange_reason'])) {
if (isset($data['data']['special_exchange_reason']) && $isLimited) {
foreach ($result['reason'] as $key => $item) {
if (!in_array($item, $data['data']['special_exchange_reason'])) {
$result['reason'][$key]['inactive'] = true;
... ...