From b8f90dbd956b9a59ad10e8a687723baffa08c054 Mon Sep 17 00:00:00 2001 From: rr- Date: Wed, 25 Nov 2015 08:13:25 +0100 Subject: [PATCH] Fixed stats cron job --- scripts/cron-stats | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cron-stats b/scripts/cron-stats index ffb565c3..deba539b 100755 --- a/scripts/cron-stats +++ b/scripts/cron-stats @@ -39,4 +39,5 @@ $pdo->exec('UPDATE posts SET score = (SELECT SUM(score) FROM scores WHERE postId $pdo->exec('UPDATE posts SET favCount = (SELECT COUNT(1) FROM favorites WHERE postId = posts.id)'); $pdo->exec('UPDATE posts SET lastFavTime = (SELECT MAX(time) FROM favorites WHERE postId = posts.id)'); $pdo->exec('UPDATE posts SET commentCount = (SELECT COUNT(1) FROM comments WHERE postId = posts.id)'); -$pdo->exec('UPDATE posts SET lastCommentTime = (SELECT MAX(lastEditTime) FROM comments WHERE postId = posts.id)'); +$pdo->exec('UPDATE posts SET lastCommentCreationTime = (SELECT MAX(creationTime) FROM comments WHERE postId = posts.id)'); +$pdo->exec('UPDATE posts SET lastCommentEditTime = (SELECT MAX(lastEditTime) FROM comments WHERE postId = posts.id)');