소스 검색

完善功能

gorden 1 년 전
부모
커밋
115b820e5f
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      app/admin/controller/order/RefundController.php

+ 6 - 6
app/admin/controller/order/RefundController.php

@@ -82,11 +82,11 @@ class RefundController extends Curd
         foreach ($items as &$item){
             if (!empty($item['order_return_apply_json']) && is_json($item['order_return_apply_json'])){
                 $json = json_decode($item['order_return_apply_json'],true);
-                $item['order_return_apply_json'] = $json['apply'];
+                $item['order_return_apply_json'] = $json['apply'] ?? '';
             }
             if (!empty($item['order_return_recharge_json']) && is_json($item['order_return_recharge_json'])){
                 $json = json_decode($item['order_return_recharge_json'],true);
-                $item['order_return_recharge_json'] = $json['change'];
+                $item['order_return_recharge_json'] = $json['change'] ?? '';
             }
 
         }
@@ -166,13 +166,13 @@ class RefundController extends Curd
             }
 
             if (!empty($item['refund'])){
-                if (!empty($item['refund']['order_return_apply_json'])){
+                if (!empty($item['refund']['order_return_apply_json'])  && is_json($item['refund']['order_return_apply_json'])){
                     $json = json_decode($item['refund']['order_return_apply_json'],true);
-                    $item['refund']['order_return_apply_json'] = $json['apply'];
+                    $item['refund']['order_return_apply_json'] = $json['apply'] ?? '';
                 }
-                if (!empty($item['refund']['order_return_recharge_json'])){
+                if (!empty($item['refund']['order_return_recharge_json'])  && is_json($item['refund']['order_return_recharge_json'])){
                     $json = json_decode($item['refund']['order_return_recharge_json'],true);
-                    $item['refund']['order_return_recharge_json'] = $json['change'];
+                    $item['refund']['order_return_recharge_json'] = $json['change'] ?? '';
                 }
             }
         }