Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
fix(fight): 完善boss技能37注释并修复技能48伤害计算逻辑 - 移除NewSeIdx_37.go中TODO注释,完善技能描述 - 修复NewSeIdx_48.go中技能48的伤害减免逻辑,统一使用Ctx().Category() - 优化modules/config/service/base.go中的缓存配置逻辑 ```
51 lines
975 B
Go
51 lines
975 B
Go
package service
|
|
|
|
import (
|
|
"blazing/cool"
|
|
|
|
"github.com/gogf/gf/v2/database/gdb"
|
|
)
|
|
|
|
// /取消redis空节点的强制缓存
|
|
func dbm_enable(m cool.IModel) *gdb.Model {
|
|
ret := cool.DBM(m)
|
|
if cool.Config.ServerInfo.IsVip == 0 { //正式服启动缓存
|
|
ret = ret.Where("is_enable", 1)
|
|
}
|
|
if cool.Config.ServerInfo.IsDebug == 0 {
|
|
|
|
ret = ret.Cache(gdb.CacheOption{
|
|
Force: true,
|
|
})
|
|
}
|
|
return ret
|
|
}
|
|
func dbm_notenable(m cool.IModel) *gdb.Model {
|
|
ret := cool.DBM(m)
|
|
if cool.Config.ServerInfo.IsDebug == 0 {
|
|
|
|
ret = ret.Cache(gdb.CacheOption{
|
|
Force: true,
|
|
})
|
|
}
|
|
return ret
|
|
}
|
|
func dbm_nocache(m cool.IModel) *gdb.Model {
|
|
ret := cool.DBM(m)
|
|
if cool.Config.ServerInfo.IsVip == 0 { //正式服启动缓存
|
|
ret = ret.Where("is_enable", 1)
|
|
}
|
|
// if cool.Config.ServerInfo.IsDebug == 0 {
|
|
|
|
// ret = ret.Cache(gdb.CacheOption{
|
|
// Force: false,
|
|
// })
|
|
// }
|
|
return ret
|
|
}
|
|
func dbm_nocache_noenable(m cool.IModel) *gdb.Model {
|
|
ret := cool.DBM(m)
|
|
|
|
return ret
|
|
}
|