gorden 10 miesięcy temu
rodzic
commit
e6274f3314
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      app/admin/service/goods/GoodsService.php

+ 5 - 2
app/admin/service/goods/GoodsService.php

@@ -261,9 +261,12 @@ class GoodsService
                 }
                 $data['goods_detail_slider_json'] = rtrim($slider, ',');
             }
-            $data['appointment_times'] = [];
-            if ($data['is_support_appointment'] == 'Y') {
+            $extendJson=[];
+            if (!empty($data['goods_attribute_json'])){
                 $extendJson = json_decode($data['goods_attribute_json'], true);
+            }
+            $data['appointment_times'] = [];
+            if ($data['is_support_appointment'] == 'Y' && isset($extendJson['dates'])) {
                 $data['dates'] = $extendJson['dates'] ?? [];
                 if (isset($extendJson['times'])) {
                     $times = [];