add more fields to device data
This commit is contained in:
parent
7c8cf0eb1b
commit
342834dfe9
|
@ -12,7 +12,7 @@ func (s Service) GetStaffPermissionsByToken(token string) (doc StaffPermissions)
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
stm, args, _ := s.Builder.
|
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)).
|
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 s ON s.id = dm.owner_id", TableStaff)).
|
||||||
Join(fmt.Sprintf("LEFT JOIN %s sr ON s.role_id = sr.id", TableStaffRole)).
|
Join(fmt.Sprintf("LEFT JOIN %s sr ON s.role_id = sr.id", TableStaffRole)).
|
||||||
|
|
1
model.go
1
model.go
|
@ -62,5 +62,6 @@ type StaffPermissions struct {
|
||||||
Name string `db:"name"`
|
Name string `db:"name"`
|
||||||
Permissions []string `db:"permissions"`
|
Permissions []string `db:"permissions"`
|
||||||
AccountType string `db:"account_type"`
|
AccountType string `db:"account_type"`
|
||||||
|
Active bool `db:"active"`
|
||||||
DeviceID string `db:"device_id"`
|
DeviceID string `db:"device_id"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue