member sort
This commit is contained in:
parent
04bab0c97e
commit
cc763001a5
1 changed files with 7 additions and 0 deletions
|
@ -24,8 +24,13 @@ export default abstract class MemberService {
|
|||
"membership_last",
|
||||
"membership_last.memberId = member.id AND membership_last.start = (SELECT MAX(m.start) FROM membership m WHERE m.memberId = member.id)"
|
||||
)
|
||||
.leftJoinAndSelect("membership_first.status", "status_first")
|
||||
.leftJoinAndSelect("membership_last.status", "status_last")
|
||||
.offset(offset)
|
||||
.limit(count)
|
||||
.orderBy("member.lastname")
|
||||
.addOrderBy("member.firstname")
|
||||
.addOrderBy("member.nameaffix")
|
||||
.getManyAndCount()
|
||||
.then((res) => {
|
||||
return res;
|
||||
|
@ -56,6 +61,8 @@ export default abstract class MemberService {
|
|||
"membership_last",
|
||||
"membership_last.memberId = member.id AND membership_last.start = (SELECT MAX(m.start) FROM membership m WHERE m.memberId = member.id)"
|
||||
)
|
||||
.leftJoinAndSelect("membership_first.status", "status_first")
|
||||
.leftJoinAndSelect("membership_last.status", "status_last")
|
||||
.where("member.id = :id", { id: id })
|
||||
.getOneOrFail()
|
||||
.then((res) => {
|
||||
|
|
Loading…
Reference in a new issue