fix: shop_players 关系表主键与模型对齐

This commit is contained in:
zetaloop
2026-04-04 06:25:49 +08:00
parent 3a81aec527
commit 7dc088eadf
18 changed files with 91 additions and 310 deletions
@@ -26,7 +26,10 @@ func NewGetShopPlayersByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext)
}
func (l *GetShopPlayersByIdLogic) GetShopPlayersById(in *pb.GetShopPlayersByIdReq) (*pb.GetShopPlayersByIdResp, error) {
shopPlayer, err := l.svcCtx.ShopModelRO.ShopPlayers.Query().Where(shopplayers.IDEQ(in.Id)).First(l.ctx)
shopPlayer, err := l.svcCtx.ShopModelRO.ShopPlayers.Query().Where(
shopplayers.ShopIDEQ(in.ShopId),
shopplayers.PlayerIDEQ(in.PlayerId),
).First(l.ctx)
if err != nil {
logx.WithContext(l.ctx).Errorf("GetShopPlayersByIdLogic err: %v", err)
return nil, errors.New("get shop players by id failed")