1
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
昔念
2026-04-21 01:12:26 +08:00
parent 4b42a64da0
commit dcbd9950d3
5 changed files with 105 additions and 6 deletions

View File

@@ -3,6 +3,7 @@ package service
import (
"blazing/common/data"
"blazing/cool"
basemodel "blazing/modules/base/model"
"blazing/modules/player/model"
"context"
"strings"
@@ -345,17 +346,32 @@ func NewItemService(id uint32) *ItemService {
Service: &cool.Service{Model: model.NewPlayerBag(), UniqueKey: map[string]string{
"player_id": "角色名称不能重复",
}, PageQueryOp: &cool.QueryOp{
KeyWordField: []string{"player_id"},
FieldEQ: []string{"player_id"},
Select: `player_item.*, base_sys_user.username`,
Join: []*cool.JoinOp{
{
Model: basemodel.NewBaseSysUser(),
Alias: "base_sys_user",
Type: cool.LeftJoin,
Condition: `player_item.player_id = base_sys_user.id`,
},
},
KeyWordField: []string{"player_item.player_id", "base_sys_user.username"},
FieldEQ: []string{"player_id", "item_id"},
Where: func(ctx context.Context) [][]interface{} {
var (
//admin = cool.GetAdmin(ctx)
//userId = admin.UserId
r = g.RequestFromCtx(ctx)
)
return [][]interface{}{
where := [][]interface{}{
// {"player_id", userId, true},
// {"free", 0, true},
}
if username := strings.TrimSpace(r.Get("username").String()); username != "" {
where = append(where, []interface{}{`LOWER(base_sys_user.username) LIKE ?`, "%" + strings.ToLower(username) + "%"})
}
return where
},
}},
},