Compare commits
2 Commits
0d6d152b82
...
17d9437a50
Author | SHA1 | Date | |
---|---|---|---|
17d9437a50 | |||
aed4548c7b |
@ -102,7 +102,11 @@ class EventRepository
|
|||||||
{
|
{
|
||||||
$select->where(function (Select $select) use ($from, $days) {
|
$select->where(function (Select $select) use ($from, $days) {
|
||||||
$select->where('start', '<', (clone $from)->add(DateInterval::createFromDateString("$days days"))->format('Y-m-d H:i:s'));
|
$select->where('start', '<', (clone $from)->add(DateInterval::createFromDateString("$days days"))->format('Y-m-d H:i:s'));
|
||||||
$select->orWhere('end', '>', (clone $from)->sub(DateInterval::createFromDateString("$days days"))->format('Y-m-d H:i:s'));
|
$select->where('end', '>', $from->format('Y-m-d H:i:s'));
|
||||||
|
});
|
||||||
|
$select->orWhere(function (Select $select) use ($from, $days) {
|
||||||
|
$select->where('end', '>', (clone $from)->sub(DateInterval::createFromDateString("$days days"))->format('Y-m-d H:i:s'));
|
||||||
|
$select->where('start', '<', $from->format('Y-m-d H:i:s'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user