From 00fd7f462432840e18886eafceef5f98bbfc5e3f Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Thu, 30 Mar 2023 16:24:06 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=83=95=E3=82=A9=E3=83=AD=E3=83=AF?= =?UTF-8?q?=E3=83=BC=E4=B8=80=E8=A6=A7=E5=8F=96=E5=BE=97=E3=81=AESQL?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/usbharu/hideout/repository/UserRepository.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt b/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt index 030fd2c8..c945aab8 100644 --- a/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt +++ b/src/main/kotlin/dev/usbharu/hideout/repository/UserRepository.kt @@ -80,15 +80,18 @@ class UserRepository(private val database: Database) : IUserRepository { override suspend fun findFollowersById(id: Long): List { return query { - val followers = Users.alias("followers") - Users.leftJoin( + val followers = Users.alias("FOLLOWERS") + Users.innerJoin( otherTable = UsersFollowers, onColumn = { Users.id }, otherColumn = { UsersFollowers.userId }) - .leftJoin( + + .innerJoin( otherTable = followers, onColumn = { UsersFollowers.followerId }, otherColumn = { followers[Users.id] }) + + .slice(followers.get(Users.id), followers.get(Users.name), followers.get(Users.domain), followers.get(Users.screenName), followers.get(Users.description)) .select { Users.id eq id } .map { UserEntity(