Authored by 郭成尧

'特殊品类限制调整'

1 -存放PC模板的预编译文件  
@@ -293,8 +293,6 @@ class ReturnsModel @@ -293,8 +293,6 @@ class ReturnsModel
293 $result = array(); 293 $result = array();
294 //调用接口,根据订单号获取可退货商品信息 294 //调用接口,根据订单号获取可退货商品信息
295 $data = ReturnsData::getRefundGoodsData($orderCode, $uid); 295 $data = ReturnsData::getRefundGoodsData($orderCode, $uid);
296 -  
297 - $isLimited = false;  
298 296
299 //调用接口成功,封装数据 297 //调用接口成功,封装数据
300 if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['goods_list']) && !empty($data['data']['goods_list'])) { 298 if (isset($data['code']) && $data['code'] == 200 && isset($data['data']['goods_list']) && !empty($data['data']['goods_list'])) {
@@ -317,31 +315,30 @@ class ReturnsModel @@ -317,31 +315,30 @@ class ReturnsModel
317 $result['goods'][$key]['goods_type'] = $value['goods_type']; 315 $result['goods'][$key]['goods_type'] = $value['goods_type'];
318 $amount += $value['last_price'];//所以商品价格加起来,等于订单总价 316 $amount += $value['last_price'];//所以商品价格加起来,等于订单总价
319 317
  318 + $result['goods'][$key]['reason'] = $data['data']['return_reason'];
  319 +
320 // tar note 为每个特殊商品都添加标识 320 // tar note 为每个特殊商品都添加标识
321 if ($value['is_limit_skn'] === 'Y') { 321 if ($value['is_limit_skn'] === 'Y') {
322 $result['goods'][$key]['specialNoticeBo'] = $data['data']['special_notice']; 322 $result['goods'][$key]['specialNoticeBo'] = $data['data']['special_notice'];
323 - $isLimited = true; 323 + // tar note 对数组做处理,为不显示的添加 inactive
  324 + if (isset($data['data']['special_return_reason'])) {
  325 + foreach ($result['goods'][$key]['reason'] as $subKey => $item) {
  326 + if (!in_array($item, $data['data']['special_return_reason'])) {
  327 + $result['goods'][$key]['reason'][$subKey]['inactive'] = true;
  328 + }
  329 + }
  330 + }
324 } 331 }
325 332
  333 + // 对原因排序
  334 + asort($result['goods'][$key]['reason']);
  335 +
326 //商品中有鞋类,传给前端标识 336 //商品中有鞋类,传给前端标识
327 if ($value['hasShoes']) { 337 if ($value['hasShoes']) {
328 $result['tips']['footwear'] = true; 338 $result['tips']['footwear'] = true;
329 } 339 }
330 } 340 }
331 $result['orderCode'] = $orderCode; 341 $result['orderCode'] = $orderCode;
332 - $result['reason'] = $data['data']['return_reason'];  
333 -  
334 - // tar note 对数组做处理,为不显示的添加 inactive  
335 - if (isset($data['data']['special_return_reason']) && $isLimited) {  
336 - foreach ($result['reason'] as $key => $item) {  
337 - if (!in_array($item, $data['data']['special_return_reason'])) {  
338 - $result['reason'][$key]['inactive'] = true;  
339 - }  
340 - }  
341 - }  
342 -  
343 - // 对原因排序  
344 - asort($result['reason']);  
345 342
346 //计算相关支付细节 343 //计算相关支付细节
347 $result['amount'] = $amount - $data['data']['yoho_coin_num'] - $data['data']['coupon_amount']; 344 $result['amount'] = $amount - $data['data']['yoho_coin_num'] - $data['data']['coupon_amount'];
@@ -404,31 +401,30 @@ class ReturnsModel @@ -404,31 +401,30 @@ class ReturnsModel
404 $result['goods'][$key]['sku'] = $value['product_sku']; 401 $result['goods'][$key]['sku'] = $value['product_sku'];
405 $result['goods'][$key]['goods_type_id'] = $value['goods_type_id']; 402 $result['goods'][$key]['goods_type_id'] = $value['goods_type_id'];
406 403
  404 + $result['goods'][$key]['reason'] = $data['data']['exchange_reason'];
  405 +
407 // tar note 为每个特殊商品都添加标识 406 // tar note 为每个特殊商品都添加标识
408 if ($value['is_limit_skn'] === 'Y') { 407 if ($value['is_limit_skn'] === 'Y') {
409 $result['goods'][$key]['specialNoticeBo'] = $data['data']['specialNoticeBo']; 408 $result['goods'][$key]['specialNoticeBo'] = $data['data']['specialNoticeBo'];
410 - $isLimited = true; 409 + // tar note 对数组做处理,为不显示的添加 inactive
  410 + if (isset($data['data']['special_exchange_reason'])) {
  411 + foreach ($result['goods'][$key]['reason'] as $subKey => $item) {
  412 + if (!in_array($item, $data['data']['special_exchange_reason'])) {
  413 + $result['goods'][$key]['reason'][$subKey]['inactive'] = true;
  414 + }
  415 + }
  416 + }
411 } 417 }
412 418
  419 + // 对原因排序
  420 + asort($result['goods'][$key]['reason']);
  421 +
413 //给前端标识出鞋类 422 //给前端标识出鞋类
414 if ($value['hasShoes']) { 423 if ($value['hasShoes']) {
415 $result['tips']['footwear'] = true; 424 $result['tips']['footwear'] = true;
416 } 425 }
417 $productSkn[] += $value['product_skn']; 426 $productSkn[] += $value['product_skn'];
418 } 427 }
419 - $result['reason'] = $data['data']['exchange_reason'];  
420 -  
421 - // tar note 对数组做处理,为不显示的添加 inactive  
422 - if (isset($data['data']['special_exchange_reason']) && $isLimited) {  
423 - foreach ($result['reason'] as $key => $item) {  
424 - if (!in_array($item, $data['data']['special_exchange_reason'])) {  
425 - $result['reason'][$key]['inactive'] = true;  
426 - }  
427 - }  
428 - }  
429 -  
430 - // 对原因排序  
431 - asort($result['reason']);  
432 428
433 $result['orderCode'] = $orderCode; 429 $result['orderCode'] = $orderCode;
434 430