FIX_BDS_PT_CO_RMV_ISSUE : RV
This commit is contained in:
parent
f4e2fa3a21
commit
a744b8e105
@ -418,7 +418,7 @@ class PolicyTransactionController extends BaseController
|
|||||||
// die;
|
// die;
|
||||||
|
|
||||||
if(isset($data['co_share_id']) && !empty($data['co_share_id'])){
|
if(isset($data['co_share_id']) && !empty($data['co_share_id'])){
|
||||||
$this->removePtCoShareRecords($data['co_share_id']);
|
$this->removePtCoShareRecords($data['co_share_id'], $pt_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($data['follow_insurer_id'])){
|
if(isset($data['follow_insurer_id'])){
|
||||||
@ -967,22 +967,27 @@ class PolicyTransactionController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//function for soft delete for pt_co_share_details records
|
//function for soft delete for pt_co_share_details records
|
||||||
public function removePtCoShareRecords($primaryKeys)
|
public function removePtCoShareRecords($primaryKeys, $pt_id)
|
||||||
{
|
{
|
||||||
// print_r($primaryKeys); die;
|
|
||||||
if (empty($primaryKeys)) {
|
if (empty($primaryKeys)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert array to a comma-separated string for query binding
|
// Convert array to a comma-separated string of placeholders for query binding
|
||||||
$placeholders = implode(',', array_fill(0, count($primaryKeys), '?'));
|
$placeholders = implode(',', array_fill(0, count($primaryKeys), '?'));
|
||||||
|
|
||||||
$sql = "UPDATE pt_co_share_details SET is_active = 0 WHERE id NOT IN ($placeholders)";
|
// Prepare the query with proper binding
|
||||||
|
$sql = "UPDATE pt_co_share_details SET is_active = 0 WHERE pt_id = ? AND id NOT IN ($placeholders)";
|
||||||
|
|
||||||
return db_connect()->query($sql, $primaryKeys);
|
// Merge pt_id with primary keys for binding
|
||||||
|
$params = array_merge([$pt_id], $primaryKeys);
|
||||||
|
|
||||||
|
// Execute the query with bound parameters
|
||||||
|
return db_connect()->query($sql, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Policy Transaction Endorsement
|
// Policy Transaction Endorsement
|
||||||
|
|||||||
@ -319,8 +319,10 @@ class EmployeePolicyModel extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Always check these conditions
|
// Always check these conditions
|
||||||
$result->where('employee_polices.is_active', 1)
|
$result
|
||||||
->where('emp.is_active', 1);
|
->where('employee_polices.is_active', 1)
|
||||||
|
->where('emp.is_active', 1)
|
||||||
|
->where('employee_polices.status !=', 'inactive');
|
||||||
|
|
||||||
$res = $result->findAll();
|
$res = $result->findAll();
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user