Browse Source

优化切换模式

master
wanghongjun 3 weeks ago
parent
commit
01c5f76f41
  1. 10
      app/Services/EventCalendarService.php

10
app/Services/EventCalendarService.php

@ -260,9 +260,15 @@ class EventCalendarService extends BaseService
'event_calendar.update'
);
}
$now_time = date("Y-m-d H:i:s", time());
$query = EventCalendar::query()->where('pattern_id', $pattern_id)
->whereIn('status', [0, 1])->first();
->whereIn('status', [0, 1])
->where(function ($query) use ($now_time) {
$query->whereRaw(
"'{$now_time}' BETWEEN start_time AND end_time"
);
})
->first();
$end_time = get_datetime('datetime', strtotime($end_time));
$save = [

Loading…
Cancel
Save