📅  最后修改于: 2022-03-11 14:59:44.890000             🧑  作者: Mango
def get_member_2!(id) do
query =
from(
p in Member,
where: p.id == ^id,
select: p,
preload: [
:avatar,
activities:
^from(
a in Activity,
order_by: [desc: a.inserted_at]
)
]
)
Repo.one!(query)
end