refactor(service): 重构用户服务数据库查询逻辑,将DBM调用封装为Model方法并添加GetModel注释
This commit is contained in:
@@ -3,6 +3,8 @@ package service
|
||||
import (
|
||||
"blazing/cool"
|
||||
"blazing/modules/blazing/model"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
)
|
||||
|
||||
type UserService struct {
|
||||
@@ -29,3 +31,7 @@ func NewUserService(id uint32) *UserService {
|
||||
}
|
||||
|
||||
}
|
||||
func (s *UserService) Model(m cool.IModel) *gdb.Model {
|
||||
|
||||
return cool.DBM(m).Where("player_id", s.userid)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user