diff --git a/classes/oai/ops/OAIDAO.php b/classes/oai/ops/OAIDAO.php index 7d23098a51..bfbbd4549d 100644 --- a/classes/oai/ops/OAIDAO.php +++ b/classes/oai/ops/OAIDAO.php @@ -253,10 +253,10 @@ public function _getRecordsRecordSetQuery($setIds, $from, $until, $set, $submiss return $query->where('p.section_id', '=', $sectionId); }) ->when($from, function ($query, $from) { - return $query->where('a.last_modified', '>=', $this->datetimeToDB($from)); + return $query->whereDate('a.last_modified', '>=', \DateTime::createFromFormat('U', $from)); }) ->when($until, function ($query, $until) { - return $query->where('a.last-modified', '<=', $this->datetimeToDB($until)); + return $query->whereDate('a.last-modified', '<=', \DateTime::createFromFormat('U', $until)); }) ->when($submissionId, function ($query, $submissionId) { return $query->where('a.submission_id', '=', $submissionId); @@ -295,10 +295,10 @@ public function _getRecordsRecordSetQuery($setIds, $from, $until, $set, $submiss ->orWhere('dot.set_spec', 'like', $set . ':%'); }) ->when($from, function ($query, $from) { - return $query->where('dot.date_deleted', '>=', $from); + return $query->whereDate('dot.date_deleted', '>=', \DateTime::createFromFormat('U', $from)); }) ->when($until, function ($query, $until) { - return $query->where('dot.date_deleted', '<=', $until); + return $query->whereDate('dot.date_deleted', '<=', \DateTime::createFromFormat('U', $until)); }) ->when($submissionId, function ($query, $submissionId) { return $query->where('dot.data_object_id', '=', (int) $submissionId);