2019-05-03 06:17:27 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-31 20:02:26 +08:00
|
|
|
class Admin::ScreenedUrlsController < Admin::StaffController
|
2013-08-15 22:48:30 +08:00
|
|
|
def index
|
2013-11-05 05:31:31 +08:00
|
|
|
screened_urls =
|
|
|
|
ScreenedUrl
|
|
|
|
.select(
|
|
|
|
"domain, sum(match_count) as match_count, max(last_match_at) as last_match_at, min(created_at) as created_at",
|
2023-01-09 20:20:10 +08:00
|
|
|
)
|
2013-11-05 05:31:31 +08:00
|
|
|
.group(:domain)
|
|
|
|
.order("last_match_at DESC")
|
|
|
|
.to_a
|
2013-11-05 05:24:32 +08:00
|
|
|
render_serialized(screened_urls, GroupedScreenedUrlSerializer)
|
2013-08-15 22:48:30 +08:00
|
|
|
end
|
|
|
|
end
|