17 if (!Loader::includeModule(
"forum"))
22 if (Main\
Config\Option::get(
"forum",
"LivefeedConvertServiceMessageStepper") ===
"inProgress")
27 if (!array_key_exists(
"lastId", $result) || (
int)$result[
"lastId"] <= 0)
29 $result[
"lastId"] = 0;
31 $res = MessageTable::getList([
40 $topicData = $res->fetch();
41 $result[
"count"] = (int)$topicData[
'CNT'];
47 if ($result[
"lastId"] > 0)
49 $filter[
"<TOPIC_ID"] = $result[
"lastId"];
52 Main\Config\Option::set(
"forum",
"TopicServiceCounterStepper",
"inProgress");
56 $res = MessageTable::getList([
57 "select" => [
"TOPIC_ID",
"CNT"],
62 "group" => [
"TOPIC_ID"],
63 "limit" => self::TOPIC_LIMIT,
64 "order" => [
"TOPIC_ID" =>
"DESC"]
66 while($topicData = $res->fetch())
68 $topic = \Bitrix\Forum\EO_Topic::wakeUp($topicData[
"TOPIC_ID"]);
69 $topic->setPostsService($topicData[
"CNT"]);
71 $lastId = $topicData[
"TOPIC_ID"];
76 $result[
"lastId"] = $lastId;