update
parent
779eb57080
commit
13d3e85317
|
@ -65,11 +65,12 @@ func RestoreDefault(key string) error {
|
|||
}
|
||||
|
||||
func Get(key string) string {
|
||||
var value string
|
||||
store.DB.
|
||||
Raw(`select "value" from "attributes" where "key" = ?`, key).
|
||||
Scan(&value)
|
||||
return value
|
||||
a := &Attribute{}
|
||||
store.DB.Select("value", "default").First(a, "key = ?", key)
|
||||
if a.Value == "" {
|
||||
return a.Default
|
||||
}
|
||||
return a.Value
|
||||
}
|
||||
|
||||
func Set(key, value string) error {
|
||||
|
|
Loading…
Reference in New Issue