diff --git a/app/main/api/internal/logic/query/querydetailbyorderidlogic.go b/app/main/api/internal/logic/query/querydetailbyorderidlogic.go index b5df264..281aa2b 100644 --- a/app/main/api/internal/logic/query/querydetailbyorderidlogic.go +++ b/app/main/api/internal/logic/query/querydetailbyorderidlogic.go @@ -52,8 +52,12 @@ func (l *QueryDetailByOrderIdLogic) QueryDetailByOrderId(req *types.QueryDetailB } return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告查询, 查找报告错误: %+v", err) } + user, err := l.svcCtx.UserModel.FindOne(l.ctx, userId) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrCode(xerr.DB_ERROR), "报告查询, 查找用户错误: %+v", err) + } // 安全验证:确保订单属于当前用户 - if order.UserId != userId { + if user.Inside != 1 && order.UserId != userId { return nil, errors.Wrapf(xerr.NewErrCode(xerr.LOGIC_QUERY_NOT_FOUND), "无权查看此订单报告") } // 创建渐进式延迟策略实例