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",
|
||||||
"membership_last.memberId = member.id AND membership_last.start = (SELECT MAX(m.start) FROM membership m WHERE m.memberId = member.id)"
|
"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)
|
.offset(offset)
|
||||||
.limit(count)
|
.limit(count)
|
||||||
|
.orderBy("member.lastname")
|
||||||
|
.addOrderBy("member.firstname")
|
||||||
|
.addOrderBy("member.nameaffix")
|
||||||
.getManyAndCount()
|
.getManyAndCount()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res;
|
return res;
|
||||||
|
@ -56,6 +61,8 @@ export default abstract class MemberService {
|
||||||
"membership_last",
|
"membership_last",
|
||||||
"membership_last.memberId = member.id AND membership_last.start = (SELECT MAX(m.start) FROM membership m WHERE m.memberId = member.id)"
|
"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 })
|
.where("member.id = :id", { id: id })
|
||||||
.getOneOrFail()
|
.getOneOrFail()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
Loading…
Reference in a new issue