FHM08062601IBL - fallback resolve payment id dari order id di birt_proxy stream_by_code
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,10 @@ class Birt_proxy extends MY_Controller
|
||||
$order_id = $this->_resolve_order_id_by_payment($payment_id);
|
||||
}
|
||||
|
||||
if ($payment_id <= 0 && $order_id > 0) {
|
||||
$payment_id = $this->_resolve_payment_id_by_order($order_id);
|
||||
}
|
||||
|
||||
if ($order_id <= 0) {
|
||||
$this->sys_error('order_id tidak ditemukan');
|
||||
return;
|
||||
@@ -332,6 +336,20 @@ class Birt_proxy extends MY_Controller
|
||||
return intval($row['F_PaymentT_OrderHeaderID'] ?? 0);
|
||||
}
|
||||
|
||||
private function _resolve_payment_id_by_order($order_id)
|
||||
{
|
||||
$row = $this->db_onedev->query(
|
||||
"SELECT F_PaymentID
|
||||
FROM f_payment
|
||||
WHERE F_PaymentT_OrderHeaderID = ?
|
||||
ORDER BY F_PaymentID DESC
|
||||
LIMIT 1",
|
||||
[$order_id]
|
||||
)->row_array();
|
||||
|
||||
return intval($row['F_PaymentID'] ?? 0);
|
||||
}
|
||||
|
||||
private function _resolve_patient_name_by_cache($cache_id)
|
||||
{
|
||||
if (!$cache_id) {
|
||||
|
||||
Reference in New Issue
Block a user