支付失败或订单取消后,优惠券提示已达到使用上限。要确认订单是否真正创建、取消流程是否回滚以及自定义支付是否绕过事件。
实际处理步骤
- 查询salesrule_coupon_usage、salesrule_customer和相关订单状态,按coupon_id、customer_id核对计数。
- 正常取消订单应通过Order Management执行;直接更新state/status不会触发优惠券使用次数回滚。
- 检查支付失败逻辑是否重复调用下单或重复派发sales_order_place_after,确保一次订单只增加一次。
- 历史数据先列出应回滚的订单并备份,再使用服务层或审计脚本逐单纠正,禁止无条件重置全部计数。
检查命令
SELECT coupon_id,customer_id,times_used FROM salesrule_coupon_usage WHERE coupon_id=:coupon_id;SELECT rule_id,customer_id,times_used FROM salesrule_customer WHERE rule_id=:rule_id AND customer_id=:customer_id;SELECT increment_id,state,status,coupon_code FROM sales_order WHERE coupon_code=:code;
验证结果
成功订单占用一次,取消后按规则释放,支付重试不重复累计,客户与全局使用上限都正确。

