fix: shop_players 关系表主键与模型对齐
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user