$this->joinSnapshot(now())
->whereRaw('exists(
select *
from baskets
where baskets.period_from >= ABS(DATEDIFF(NOW(), loan_snapshots.prolongated_return_date))
and (baskets.period_to <= ABS(DATEDIFF(NOW(), loan_snapshots.prolongated_return_date)) or baskets.period_to is null)
and baskets.id in (?)
)', [$basket]);
оу, выглядит не очень
Обсуждают сегодня