This commit is contained in:
邓皓元 2019-02-26 17:05:59 +08:00
parent b47c0e1e01
commit c1d41f7b73

View File

@ -76,7 +76,9 @@ class FlowPoolRepository extends Repository
if (isset($conditions['month'])) {
$time = Carbon::parse($conditions['month'])->format('Y-m-d H:i:s');
$this->model = $this->model->where(function ($subQuery) use ($time) {
$subQuery->where('start_at', '<=', $time)->where('end_at', '>=', $time);
$subQuery->where('start_at', '<=', $time)->where(function ($endAtQuery) use ($time) {
$endAtQuery->where('end_at', '>=', $time)->orWhereNull('end_at');
});
});
}