add username on user activity

This commit is contained in:
2024-12-02 14:15:38 +07:00
parent 9e8130df53
commit c5e721dd0b

View File

@ -98,7 +98,7 @@ export class UserActivityController {
const res_count = userRepository.createQueryBuilder()
.where(whereAttr, whereVal);
const res_list = userRepository.createQueryBuilder()
.addSelect('(select user.name from user user where user.id=User_role.id_id_user )', 'username')
.addSelect('(SELECT u.username FROM users u WHERE u.id = id_user)', 'username')
.where(whereAttr, whereVal)
.orderBy(param.order_field, param.order_direction)
.offset(offset)
@ -212,7 +212,7 @@ export class UserActivityController {
'action',
'url',
'created_at'])
.addSelect('(select user.name from user user where user.id=User_role.id_id_user )', 'username')
.addSelect('(SELECT u.username FROM users u WHERE u.id = id_user)', 'username')
.orderBy(param.order_field, param.order_direction)
.offset(offset)
.limit(limit).getRawMany();