1234567891011121314151617181920212223242526272829303132 |
- package models
- import (
- "github.com/rdlucklib/rdluck_tools/orm"
- "time"
- )
- type CygxConfig struct {
- ConfigId int `json:"-" orm:"column(config_id);pk"`
- ConfigCode string `json:"-"`
- ConfigValue string
- Remark string `json:"-"`
- CreateTime time.Time `json:"-"`
- }
- func GetConfigByCode(configCode string) (item *CygxConfig, err error) {
- sql := `SELECT * FROM cygx_config WHERE config_code=? `
- err = orm.NewOrm().Raw(sql, configCode).QueryRow(&item)
- return
- }
- type ConfigResp struct {
- Item *CygxConfig
- }
- //获取是否展示限免标签
- func GetShowSustainable() (count int, err error) {
- o := orm.NewOrm()
- sqlCount := ` SELECT COUNT(1) FROM cygx_config WHERE config_code= 'is_show_sustainable' AND config_value = 1 `
- err = o.Raw(sqlCount).QueryRow(&count)
- return
- }
|