Skip to content

Commit

Permalink
Merge pull request pkp#4134 from bozana/9582
Browse files Browse the repository at this point in the history
pkp/pkp-lib#9582 fix get date from string and submodule update
  • Loading branch information
bozana authored Jan 6, 2024
2 parents 70366ff + ba39bfa commit 8737ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions classes/statistics/TemporaryTotalsDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace APP\statistics;

use APP\core\Application;
use DateTimeImmutable;
use Illuminate\Support\Facades\DB;
use PKP\statistics\PKPTemporaryTotalsDAO;

Expand All @@ -44,8 +45,8 @@ protected function getInsertData(object $entryData): array
*/
public function compileIssueMetrics(string $loadId): void
{
$date = substr($loadId, -12, 8);
DB::table('metrics_issue')->where('load_id', '=', $loadId)->orWhere('date', '=', DB::raw("DATE({$date})"))->delete();
$date = DateTimeImmutable::createFromFormat('Ymd', substr($loadId, -12, 8));
DB::table('metrics_issue')->where('load_id', '=', $loadId)->orWhereDate('date', '=', $date)->delete();

$selectIssueMetrics = DB::table($this->table)
->select(DB::raw('load_id, context_id, issue_id, DATE(date) as date, count(*) as metric'))
Expand Down
2 changes: 1 addition & 1 deletion lib/pkp

0 comments on commit 8737ec5

Please sign in to comment.