Skip to content

Commit

Permalink
Merge pull request pkp#3747 from bozana/8612
Browse files Browse the repository at this point in the history
pkp/pkp-lib#8612 consider date additionally to loadId for stats deletion before compiling the new stats
  • Loading branch information
bozana authored Feb 7, 2023
2 parents ca01a1a + 87cbfb9 commit d7efcd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion classes/statistics/TemporaryTotalsDAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ protected function getInsertData(object $entryData): array
*/
public function compileIssueMetrics(string $loadId): void
{
DB::table('metrics_issue')->where('load_id', '=', $loadId)->delete();
$date = substr($loadId, -12, 8);
DB::table('metrics_issue')->where('load_id', '=', $loadId)->orWhere('date', '=', DB::raw("DATE({$date})"))->delete();

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

0 comments on commit d7efcd6

Please sign in to comment.