- 添加 debug 模式配置,用于控制数据库查询时是否开启调试 -修复获取偷卡记录时的状态过滤逻辑,支持多个状态 -优化创建隐藏订单的流程,先创建新订单再更新原订单- 新增系统配置字典模型,用于获取偷卡规则状态- 移除不必要的日志输出,简化代码
32 lines
809 B
Go
32 lines
809 B
Go
package setting
|
|
|
|
import (
|
|
"github.com/beego/beego/v2/client/orm"
|
|
"time"
|
|
)
|
|
|
|
type SysConfigDict struct {
|
|
Id int `orm:"column(id);pk"`
|
|
Name string `orm:"column(name);size(255);null" description:"设置"`
|
|
Key string `orm:"column(key);null" description:""`
|
|
Value string `orm:"column(value);null" description:"金额"`
|
|
CreatedAt *time.Time `orm:"column(created_at);null"`
|
|
UpdatedAt *time.Time `orm:"column(updated_at);null"`
|
|
DeletedAt *time.Time `orm:"column(deleted_at);null"`
|
|
}
|
|
|
|
func init() {
|
|
orm.RegisterModel(new(SysConfigDict))
|
|
}
|
|
|
|
func GetStealCardConfig() bool {
|
|
v := &SysConfigDict{}
|
|
o := orm.NewOrm()
|
|
err := o.QueryTable("sys_config_dict").Filter("key", "steal_rule_status").One(v)
|
|
if err != nil {
|
|
return false
|
|
} else {
|
|
return v.Value == "1"
|
|
}
|
|
}
|