diff options
author | jloup <jloup@jloup.work> | 2018-05-13 23:14:26 +0200 |
---|---|---|
committer | jloup <jloup@jloup.work> | 2018-05-13 23:18:48 +0200 |
commit | 2e4885d98ec49203180deb7e4e9148762e4720e7 (patch) | |
tree | f018a158d2f39133a21dba899176f6fde606bd92 /db | |
parent | 6bf174a95ba0f71abf25397316fc101405381cdf (diff) | |
download | Front-2e4885d98ec49203180deb7e4e9148762e4720e7.tar.gz Front-2e4885d98ec49203180deb7e4e9148762e4720e7.tar.zst Front-2e4885d98ec49203180deb7e4e9148762e4720e7.zip |
Admin minimal dashboard.v0.0.14
Diffstat (limited to 'db')
-rw-r--r-- | db/market_config.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/db/market_config.go b/db/market_config.go index 30b4538..afb2842 100644 --- a/db/market_config.go +++ b/db/market_config.go | |||
@@ -16,6 +16,9 @@ type MarketConfig struct { | |||
16 | UserId int64 | 16 | UserId int64 |
17 | Status MarketConfigStatus | 17 | Status MarketConfigStatus |
18 | Config map[string]string | 18 | Config map[string]string |
19 | |||
20 | // Will be expanded by pg | ||
21 | User User | ||
19 | } | 22 | } |
20 | 23 | ||
21 | func InsertMarketConfig(config *MarketConfig) error { | 24 | func InsertMarketConfig(config *MarketConfig) error { |
@@ -62,3 +65,14 @@ func SetMarketConfigStatus(marketConfig MarketConfig, status MarketConfigStatus) | |||
62 | 65 | ||
63 | return &marketConfig, err | 66 | return &marketConfig, err |
64 | } | 67 | } |
68 | |||
69 | func GetActiveUsers() ([]MarketConfig, error) { | ||
70 | var configs []MarketConfig | ||
71 | |||
72 | err := DB.Model(&configs).Column("User").Where("market_config.status=?", "enabled").Select() | ||
73 | if err != nil { | ||
74 | return nil, err | ||
75 | } | ||
76 | |||
77 | return configs, nil | ||
78 | } | ||