Browse Source

完善功能

gorden 10 months ago
parent
commit
b9da29a4c6

+ 1 - 1
app/admin/service/goods/GoodsService.php

@@ -261,7 +261,7 @@ class GoodsService
                 }
                 $data['goods_detail_slider_json'] = rtrim($slider, ',');
             }
-
+            $data['appointment_times'] = [];
             if ($data['is_support_appointment'] == 'Y') {
                 $extendJson = json_decode($data['goods_attribute_json'], true);
                 $data['dates'] = $extendJson['dates'] ?? [];

+ 4 - 4
app/admin/service/order/AppointmentService.php

@@ -486,16 +486,16 @@ class AppointmentService
             ->get()
             ->toArray();
         if ($goods->is_support_appointment == 'Y' && !empty($goods->goods_extend_json)) {
-            $extendJson = json_decode($goods->goods_extend_json, true);
+            $extendJson = json_decode($goods->goods_attribute_json, true);
             $times = $extendJson['times'];
             foreach ($times as $key => $time) {
-                $timesStr = $time['appointmentTimeStart'] . '~' . $time['appointmentTimeEnd'];
-                $times[$key]['timesStr'] = $timesStr;
+//                $timesStr = $time['appointmentTimeStart'] . '~' . $time['appointmentTimeEnd'];
+                $times[$key]['timesStr'] = $time['duration'];
                 foreach ($appointments as $appointment) {
                     if (!empty($appointment['appointment_apply_json'])) {
                         $applyJson = json_decode($appointment['appointment_apply_json'], true);
                         $applyJsonTimes = $applyJson['times'] ?? '';
-                        if ($timesStr == $applyJsonTimes) {
+                        if ($time['duration'] == $applyJsonTimes) {
                             $times[$key]['person'] -= $applyJson['person'];
                             if ($times[$key]['person'] < 1) {
                                 $times[$key]['disabled'] = true;