...
|
...
|
@@ -5,7 +5,7 @@ namespace Home; |
|
|
use LibModels\Web\Home\ReturnsData;
|
|
|
use WebPlugin\Helpers;
|
|
|
use WebPlugin\HelperSearch;
|
|
|
use Plugin\Images;
|
|
|
use WebPlugin\Images;
|
|
|
use LibModels\Wap\Home\OrderData;
|
|
|
use Api\Yohobuy;
|
|
|
|
...
|
...
|
@@ -314,25 +314,31 @@ class ReturnsModel |
|
|
$result['goods'][$key]['goods_type_id'] = $value['goods_type_id'];
|
|
|
$result['goods'][$key]['goods_type'] = $value['goods_type'];
|
|
|
$amount += $value['last_price'];//所以商品价格加起来,等于订单总价
|
|
|
|
|
|
$result['goods'][$key]['reason'] = $data['data']['return_reason'];
|
|
|
|
|
|
// tar note 为每个特殊商品都添加标识
|
|
|
if ($value['is_limit_skn'] === 'Y') {
|
|
|
$result['goods'][$key]['specialNoticeBo'] = $data['data']['special_notice'];
|
|
|
// tar note 对数组做处理,为不显示的添加 inactive
|
|
|
if (isset($data['data']['special_return_reason'])) {
|
|
|
foreach ($result['goods'][$key]['reason'] as $subKey => $item) {
|
|
|
if (!in_array($item, $data['data']['special_return_reason'])) {
|
|
|
$result['goods'][$key]['reason'][$subKey]['inactive'] = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 对原因排序
|
|
|
asort($result['goods'][$key]['reason']);
|
|
|
|
|
|
//商品中有鞋类,传给前端标识
|
|
|
if ($value['hasShoes']) {
|
|
|
$result['tips']['footwear'] = true;
|
|
|
}
|
|
|
}
|
|
|
$result['orderCode'] = $orderCode;
|
|
|
$result['reason'] = $data['data']['return_reason'];
|
|
|
|
|
|
// tar note 对数组做处理,为不显示的添加 inactive
|
|
|
if (isset($data['data']['special_exchange_reason'])) {
|
|
|
foreach ($result['reason'] as $key => $item) {
|
|
|
if (!in_array($item, $data['data']['special_exchange_reason'])) {
|
|
|
$result['reason'][$key]['inactive'] = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 对原因排序
|
|
|
asort($result['reason']);
|
|
|
|
|
|
//计算相关支付细节
|
|
|
$result['amount'] = $amount - $data['data']['yoho_coin_num'] - $data['data']['coupon_amount'];
|
...
|
...
|
@@ -374,6 +380,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'])) {
|
...
|
...
|
@@ -393,30 +401,30 @@ class ReturnsModel |
|
|
$result['goods'][$key]['sku'] = $value['product_sku'];
|
|
|
$result['goods'][$key]['goods_type_id'] = $value['goods_type_id'];
|
|
|
|
|
|
$result['goods'][$key]['reason'] = $data['data']['exchange_reason'];
|
|
|
|
|
|
// tar note 为每个特殊商品都添加标识
|
|
|
if ($value['is_limit_skn'] === 'Y') {
|
|
|
$result['goods'][$key]['specialNoticeBo'] = $data['data']['specialNoticeBo'];
|
|
|
// tar note 对数组做处理,为不显示的添加 inactive
|
|
|
if (isset($data['data']['special_exchange_reason'])) {
|
|
|
foreach ($result['goods'][$key]['reason'] as $subKey => $item) {
|
|
|
if (!in_array($item, $data['data']['special_exchange_reason'])) {
|
|
|
$result['goods'][$key]['reason'][$subKey]['inactive'] = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 对原因排序
|
|
|
asort($result['goods'][$key]['reason']);
|
|
|
|
|
|
//给前端标识出鞋类
|
|
|
if ($value['hasShoes']) {
|
|
|
$result['tips']['footwear'] = true;
|
|
|
}
|
|
|
$productSkn[] += $value['product_skn'];
|
|
|
}
|
|
|
$result['reason'] = $data['data']['exchange_reason'];
|
|
|
|
|
|
// tar note 对数组做处理,为不显示的添加 inactive
|
|
|
if (isset($data['data']['special_exchange_reason'])) {
|
|
|
foreach ($result['reason'] as $key => $item) {
|
|
|
if (!in_array($item, $data['data']['special_exchange_reason'])) {
|
|
|
$result['reason'][$key]['inactive'] = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 对原因排序
|
|
|
asort($result['reason']);
|
|
|
|
|
|
$result['orderCode'] = $orderCode;
|
|
|
|
...
|
...
|
|