forgeplus/app/controllers/home/platform_statistics_control...

10 lines
552 B
Ruby

class Home::PlatformStatisticsController < ApplicationController
def index
@platform_statistic = PlatformStatistic.data
@project_statistic = ProjectStatistic.data
@platform_statistic.increment!(:visits)
@tasks_count = ActiveRecord::Base.connection.exec_query("SELECT COUNT(1) FROM tasks b LEFT JOIN task_details a ON a.task_id = b.id WHERE b.is_delete = 0 AND b.published = 1 AND status IN (3, 4, 5, 6, 7, 8)").rows[0][0]
@memos_count = ActiveRecord::Base.connection.exec_query("SELECT COUNT(*) FROM memos").rows[0][0]
end
end