linwu 3 months ago
parent
commit
1230e5a485
1 changed files with 6 additions and 5 deletions
  1. 6 5
      app/common/model/Appointment.php

+ 6 - 5
app/common/model/Appointment.php

@@ -52,7 +52,8 @@ class Appointment extends Model
     {
         $daytimestamp = strtotime($daytime);
         if (strtotime(date('Y-m-d')) > $daytimestamp) {
-            throw new Exception("该时间已过期,请重新选择时间");
+            $daytimestamp = strtotime($daytime . ' +1 year');
+//            throw new Exception("该时间已过期,请重新选择时间");
         }
 
         $daytimeWeek = date('w', $daytimestamp);
@@ -67,11 +68,11 @@ class Appointment extends Model
                         continue;
                     }
                     (new AppointmentTicket())->allowField(true)->save([
-                        'appointment_id' => $appoint->id,
+                        'appointment_id'      => $appoint->id,
                         'appointment_daytime' => $daytimestamp,
-                        'address_id' => $appoint->specialist->address_id,
-                        'provider_id' => $appoint->provider_id,
-                        'status' => AppointmentTicket::STATUS_OPEN
+                        'address_id'          => $appoint->specialist->address_id,
+                        'provider_id'         => $appoint->provider_id,
+                        'status'              => AppointmentTicket::STATUS_OPEN,
                     ]);
                 }
             }