1234567891011121314151617181920212223242526272829303132333435 |
- package company
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- const (
- ConfAreaCodeListKey = "area_code_list" // 手机号区号列表
- )
- type CrmConfig struct {
- ConfigValue string `description:"详情"`
- }
- func GetConfigValueByCode(configCode string) (total int, err error) {
- o := orm.NewOrm()
- sql := ` SELECT config_value FROM crm_config WHERE config_code=? `
- err = o.Raw(sql, configCode).QueryRow(&total)
- return
- }
- // 修改
- func CrmConfigUpdate(newValue, configCode string) (err error) {
- o := orm.NewOrm()
- sql := `UPDATE crm_config SET config_value=? WHERE config_code= ?`
- _, err = o.Raw(sql, newValue, configCode).Exec()
- return
- }
- func GetConfigDetailByCode(configCode string) (item CrmConfig, err error) {
- o := orm.NewOrm()
- sql := ` SELECT config_value FROM crm_config WHERE config_code=? `
- err = o.Raw(sql, configCode).QueryRow(&item)
- return
- }
|