次のようなことを実行したいと思います。
最初にユーザーが「フォローしている」ユーザーで、次に追加のポイントスコアで並べ替えられたユーザーのリストを返したいと思います。私が書いた以下のコードは機能しません。なぜなら、資金提供者は持ち上げられた Slick タイプであり、リストに決して見つからないからです。
//The following represents the query for only funders who we are following
val following_funders: List[User] = (
for {
funder <- all_funders
f <- follows if f.followerId === id //get all the current users follower objects
if f.followeeId === funder.id
} yield funder
).list
val all_funders_sorted = for {
funder <- all_funders
following_funder = following_funders contains funder
} yield (funder, following_funder)
//sort the funders by whether or not they are following the funder and then map it to only the funders (i.e. remove the boolean)
all_funders_sorted.sortBy(_._2.desc).sortBy(_._1.score.desc).map( x => x._1 )
すべての助けに感謝します!