linwu 3 月之前
父節點
當前提交
1230e5a485
共有 1 個文件被更改,包括 6 次插入5 次删除
  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,
                     ]);
                 }
             }