14 private static $limit = 10;
18 return 'User statistic calculation';
32 private static function do()
34 $limit = self::$limit;
35 $dbRes = Main\Application::getConnection()->query(<<<SQL
37FROM b_forum_service_statistic_queue
38WHERE ENTITY_TYPE=
'USER'
45 while (($res = $dbRes->fetch()))
47 if ($usr =
Forum\User::getById($res[
'ENTITY_ID']))
49 $usr->calculateStatistic();
56 Main\Application::getConnection()->queryExecute(<<<SQL
57DELETE FROM b_forum_service_statistic_queue WHERE ID >= {$last[
'ID']} AND ENTITY_TYPE=
'USER'
66 Main\Application::getConnection()->queryExecute(<<<SQL
67INSERT IGNORE INTO b_forum_service_statistic_queue (ENTITY_TYPE, ENTITY_ID)
68SELECT
'USER', AUTHOR_ID
70WHERE TOPIC_ID = {$topicId} AND AUTHOR_ID > 0 AND APPROVED=
'Y'
79 $topicIds = implode(
', ', array_map(
'intval', $topicIds));
84 Main\Application::getConnection()->queryExecute(<<<SQL
85INSERT IGNORE INTO b_forum_service_statistic_queue (ENTITY_TYPE, ENTITY_ID)
86SELECT
'USER', AUTHOR_ID
88WHERE TOPIC_ID IN ({$topicIds}) AND AUTHOR_ID > 0 AND APPROVED=
'Y'
static loadMessages($file)