This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"blazing/modules/player/service"
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/container/gmap"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
@@ -48,3 +49,24 @@ func (c *PetBagController) GetSession(ctx context.Context, req *PetGetReq) (res
|
||||
return
|
||||
|
||||
}
|
||||
func (c *PetBagController) Level(ctx context.Context, req *PetLevelReq) (res *cool.BaseRes, err error) {
|
||||
m := gmap.New()
|
||||
|
||||
for _, v := range service.NewUserService(0).Pet.Pet_LEVEL_all() {
|
||||
v.PlayerID
|
||||
// SELECT
|
||||
// pp.player_id,
|
||||
// (pp.data->>'ID')::INT AS id,
|
||||
// (pp.data->>'Level')::INT AS level
|
||||
// FROM "player_pet" pp
|
||||
// WHERE (pp.data->>'Level')::INT > 100
|
||||
// ORDER BY level DESC;
|
||||
}
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
type PetLevelReq struct {
|
||||
g.Meta `path:"/getlevel" method:"GET"`
|
||||
// 新增:精灵相关参数(完全对齐自定义表单配置)
|
||||
}
|
||||
|
||||
@@ -98,6 +98,11 @@ func (s *PetService) Pet_del(cachetime uint32) {
|
||||
s.TestModel(s.Model).Where("player_id", s.userid).Where("catch_time", cachetime).Delete()
|
||||
|
||||
}
|
||||
func (s *PetService) Pet_LEVEL_all()[]model.Pet {
|
||||
var tt []model.Pet
|
||||
s.TestModel(s.Model).Wheref(`(pp.data->>'Level')::INT > 100`, "array").Scan(&tt)
|
||||
return tt
|
||||
}
|
||||
|
||||
// 精灵真正添加后的捕捉时间才是真正的时间
|
||||
func (s *PetService) PetAdd(y *model.PetInfo) {
|
||||
@@ -132,6 +137,7 @@ RETURNING max_ts;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// func (s *PetService) ModifyBefore(ctx context.Context, method string, param map[string]interface{}) (err error) {
|
||||
// admin := cool.GetAdmin(ctx)
|
||||
// userId := admin.UserId
|
||||
|
||||
Reference in New Issue
Block a user