修复小额打款工单关联未命中组合索引 (#135)

This commit is contained in:
WuYongJie 2026-09-09 10:53:53 +08:00
parent 46107e196f
commit a50b7596e8

View File

@ -211,6 +211,9 @@ class SmallPaymentWorkOrderMirrorRepository
$join->on('work_order_versions.woNo', '=', 'p.woNo');
})
->join($workOrders . ' AS w', 'w.Id', '=', 'work_order_versions.Id')
// Match the leading columns of (woTypeId, woNo, Id), rather than
// rescanning all orders of this type for every payment-map row.
->whereColumn('w.woNo', 'p.woNo')
->where('p.woTypeId', self::SMALL_PAYMENT_WORK_TYPE_ID)
->where('w.woTypeId', self::SMALL_PAYMENT_WORK_TYPE_ID);
}