From 4f87c0697697b1df8c0d43a36fb7e11b5c32d1f4 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 4 Apr 2023 17:15:45 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20bot=E5=AE=89=E8=A3=85=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8C=89=E5=AE=89=E8=A3=85=E8=80=85=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/installations_controller.rb | 2 +- app/views/installations/index.json.jbuilder | 2 +- app/views/installations/show.json.jbuilder | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/installations_controller.rb b/app/controllers/installations_controller.rb index 76984ee58..f13f7f459 100644 --- a/app/controllers/installations_controller.rb +++ b/app/controllers/installations_controller.rb @@ -8,7 +8,7 @@ class InstallationsController < ApplicationController end def index - @install_bots = BotInstall.where(bot_id: get_bot_id) + @install_bots = BotInstall.where(bot_id: get_bot_id).group(:installer_id) end def show diff --git a/app/views/installations/index.json.jbuilder b/app/views/installations/index.json.jbuilder index 532f4c91f..9235bd4f8 100644 --- a/app/views/installations/index.json.jbuilder +++ b/app/views/installations/index.json.jbuilder @@ -2,7 +2,7 @@ json.status 0 json.message "success" json.data do json.array! @install_bots do |install_bot| - json.extract! install_bot, :id, :bot_id, :installer_id, :state, :create_time, :update_time + json.extract! install_bot, :id, :bot_id, :installer_id json.bot_name install_bot&.bot&.name end end \ No newline at end of file diff --git a/app/views/installations/show.json.jbuilder b/app/views/installations/show.json.jbuilder index ee605b860..89db0107b 100644 --- a/app/views/installations/show.json.jbuilder +++ b/app/views/installations/show.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "commons/success" -json.extract! @install_bot, :id, :bot_id, :installer_id, :state, :create_time, :update_time +json.extract! @install_bot, :id, :bot_id, :installer_id json.bot_name @install_bot&.bot&.name