Browse Source

order Log find by server

master
linquan 3 months ago
parent
commit
f5e3baaa28
  1. 4
      internal/dao/internal/game_login_url.go
  2. 3
      internal/model/do/game_login_url.go
  3. 3
      internal/model/entity/game_login_url.go
  4. 3
      internal/serviceGame/internal/manage.go
  5. 3
      internal/serviceGame/order.go

4
internal/dao/internal/game_login_url.go

@ -20,7 +20,7 @@ type GameLoginUrlDao struct {
// GameLoginUrlColumns defines and stores column names for table game_login_url.
type GameLoginUrlColumns struct {
Id string // 100+为外网id
Id string // 1000+为外网id
Host string //
Port string //
State string // 服务器状态,1-正常,2-维护,3-白名单ip优先加渠道,4-黑名单渠道优先
@ -40,6 +40,7 @@ type GameLoginUrlColumns struct {
CreateTime string // 开服时间-用于服务器时间
Remark string // 备注名称
IsNew string //
Sort string // 后台排序
}
// gameLoginUrlColumns holds the columns for table game_login_url.
@ -64,6 +65,7 @@ var gameLoginUrlColumns = GameLoginUrlColumns{
CreateTime: "create_time",
Remark: "remark",
IsNew: "is_new",
Sort: "sort",
}
// NewGameLoginUrlDao creates and returns a new DAO object for table data access.

3
internal/model/do/game_login_url.go

@ -12,7 +12,7 @@ import (
// GameLoginUrl is the golang structure of table game_login_url for DAO operations like Where/Data.
type GameLoginUrl struct {
g.Meta `orm:"table:game_login_url, do:true"`
Id interface{} // 100+为外网id
Id interface{} // 1000+为外网id
Host interface{} //
Port interface{} //
State interface{} // 服务器状态,1-正常,2-维护,3-白名单ip优先加渠道,4-黑名单渠道优先
@ -32,4 +32,5 @@ type GameLoginUrl struct {
CreateTime *gtime.Time // 开服时间-用于服务器时间
Remark interface{} // 备注名称
IsNew interface{} //
Sort interface{} // 后台排序
}

3
internal/model/entity/game_login_url.go

@ -10,7 +10,7 @@ import (
// GameLoginUrl is the golang structure for table game_login_url.
type GameLoginUrl struct {
Id int `json:"id" description:"100+为外网id"`
Id int `json:"id" description:"1000+为外网id"`
Host string `json:"host" description:""`
Port int `json:"port" description:""`
State int `json:"state" description:"服务器状态,1-正常,2-维护,3-白名单ip优先加渠道,4-黑名单渠道优先"`
@ -30,4 +30,5 @@ type GameLoginUrl struct {
CreateTime *gtime.Time `json:"createTime" description:"开服时间-用于服务器时间"`
Remark string `json:"remark" description:"备注名称"`
IsNew int `json:"isNew" description:""`
Sort int `json:"sort" description:"后台排序"`
}

3
internal/serviceGame/internal/manage.go

@ -187,8 +187,7 @@ func GetKeepAlive(ctx context.Context, req *game.GetKeepAliveReq) (res *game.Get
}
t, _ := time.ParseInLocation(consts.TIME_FORMAT, req.CreateTime+" 00:00:00", time.Local)
registersql := fmt.Sprintf("select account, server from game_register" +
" where 1=1 ")
registersql := fmt.Sprintf("select account, server from game_register where 1=1 ")
if req.Server != 0 {
registersql += fmt.Sprintf(` and server LIKE '%s'`, "%<"+fmt.Sprint(req.Server)+">%")
}

3
internal/serviceGame/order.go

@ -306,6 +306,9 @@ func (o gameOrderImpl) GetOrderLog(ctx context.Context, req *game.OrderLogReq) (
}
if req.Channel != "" {
modelTotal = modelTotal.Where(`channel=?`, req.Channel)
if req.ServerId != 0 {
modelTotal = modelTotal.Where(`server like ?`, "<"+fmt.Sprint(req.ServerId)+">")
}
}
modelTotal.Group("channel").FieldMax("channel", "channel").FieldCount("account", "totalAccount").Scan(&res.AccountTotal)

Loading…
Cancel
Save