fix(order): 修复订单购买状态判断逻辑

- 调整isBuy方法参数顺序,确保 memberId 和 scenicId 正确传递
- 在OrderBiz中设置默认buy状态为false,避免空指针异常
- 修改OrderMapper查询条件,增加refund_status=0过滤已退款订单
- 优化face服务中调用isBuy方法时的参数传递逻辑
This commit is contained in:
2025-11-21 19:45:21 +08:00
parent 4f0d6dc44f
commit fb82329a88
3 changed files with 5 additions and 3 deletions

View File

@@ -169,7 +169,8 @@ public class OrderBiz {
respVO.setFree(false);
return respVO;
}
return isBuy(memberId, scenicId, goodsType, goodsId);
respVO.setBuy(false);
return respVO;
}
public IsBuyRespVO isBuy(Long userId, Long scenicId, int goodsType, Long goodsId) {

View File

@@ -471,7 +471,7 @@ public class FaceServiceImpl implements FaceService {
sfpContent.setTemplateCoverUrl(template.getCoverImage());
sfpContent.setGoodsType(3);
sfpContent.setSort(0);
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(face.getMemberId(), face.getScenicId(), 5, records.getFirst().getTemplateId());
IsBuyRespVO isBuyRespVO = orderBiz.isBuy(face.getScenicId(), face.getMemberId(), faceId, 5, records.getFirst().getTemplateId());
if (isBuyRespVO.isBuy()) {
sfpContent.setIsBuy(1);
} else {

View File

@@ -523,11 +523,12 @@
select o.*
from order_item oi
left join `order` o on o.id = oi.order_id
where o.member_id = #{userId}
where o.member_id = #{memberId}
and o.face_id = #{faceId}
and oi.goods_id = #{goodsId}
and oi.goods_type = #{goodsType}
and o.status = 1
and o.refund_status = 0
limit 1
</select>
<update id="updateMemberIdByFaceId">