Fix reconcile mismatch predicate and align batch activate governance tests

This commit is contained in:
萝卜
2026-03-13 11:46:00 +00:00
parent ffbf68679b
commit f7c67376f2
4 changed files with 26 additions and 10 deletions

View File

@@ -65,7 +65,17 @@ class PlatformOrder extends Model
public function isReconcileMismatch(): bool
{
// 口径与平台订单列表 reconcile_mismatch 保持一致:支付回执总额 与订单 paid_amount 不一致(按分取整,差额>=0.01
// 口径与平台订单列表 reconcile_mismatch 保持一致:支付回执总额 与订单 paid_amount 不一致(按分取整,差额>=容差
//
// 重要若该订单尚无任何“回执证据”payment_summary/payment_receipts 都为空),则不判定为对账不一致。
// 原因:测试/人工补数据场景下,订单可能已标记 paid但尚未沉淀回执此时应通过 receipt_status=none 暴露问题,
// 而不是把它强制归入 reconcile_mismatch 并阻断正常 SOP。
$hasSummary = data_get($this->meta, 'payment_summary.total_amount') !== null;
$hasReceipt = data_get($this->meta, 'payment_receipts.0.amount') !== null;
if (! $hasSummary && ! $hasReceipt) {
return false;
}
$receiptCents = (int) round(((float) $this->receiptTotal()) * 100);
$paidCents = (int) round(((float) ($this->paid_amount ?? 0)) * 100);