From 342834dfe9f594cc360823ff5dd089e784e31db2 Mon Sep 17 00:00:00 2001 From: Nam Huynh Date: Sat, 21 Aug 2021 19:40:21 +0700 Subject: [PATCH] add more fields to device data --- action_get_staff_permissions.go | 2 +- model.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/action_get_staff_permissions.go b/action_get_staff_permissions.go index 8fa62fb..1ad1604 100644 --- a/action_get_staff_permissions.go +++ b/action_get_staff_permissions.go @@ -12,7 +12,7 @@ func (s Service) GetStaffPermissionsByToken(token string) (doc StaffPermissions) ctx := context.Background() stm, args, _ := s.Builder. - Select("dm.id AS device_id, s.id, s.name, s.account_type, sr.permissions"). + Select("dm.id AS device_id, s.id, s.name, s.account_type, s.active, sr.permissions"). From(fmt.Sprintf("%s AS dm", TableDeviceMngt)). Join(fmt.Sprintf("LEFT JOIN %s s ON s.id = dm.owner_id", TableStaff)). Join(fmt.Sprintf("LEFT JOIN %s sr ON s.role_id = sr.id", TableStaffRole)). diff --git a/model.go b/model.go index dca8dde..b09288b 100644 --- a/model.go +++ b/model.go @@ -62,5 +62,6 @@ type StaffPermissions struct { Name string `db:"name"` Permissions []string `db:"permissions"` AccountType string `db:"account_type"` + Active bool `db:"active"` DeviceID string `db:"device_id"` }