12345678910111213141516171819202122232425 |
- package models
- import (
- "eta/eta_index_lib/global"
- )
- type EdbConfig struct {
- ConfigValue string `description:"详情"`
- }
- // EdbConfigUpdate 修改配置
- func EdbConfigUpdate(newValue, configCode string) (err error) {
- sql := `UPDATE edb_config SET config_value=? WHERE config_code= ?`
- err = global.DEFAULT_DB.Exec(sql, newValue, configCode).Error
- return
- }
- // GetConfigDetailByCode 根据配置编码获取配置的值
- func GetConfigDetailByCode(configCode string) (item *EdbConfig, err error) {
- sql := ` SELECT config_value FROM edb_config WHERE config_code=? `
- err = global.DEFAULT_DB.Raw(sql, configCode).First(&item).Error
- return
- }
|