FEAT_RFQNONEB_MERGE
This commit is contained in:
commit
629abacbfd
@ -4737,13 +4737,12 @@ class ClientController extends AdminController
|
||||
// echo "File does not exist.";
|
||||
// }
|
||||
|
||||
$data = $this->leadsModel->where('leads.id', 125)->where('leads.is_active', 1)->first();
|
||||
$RFQdata = $RFQModel->getRFQTableDataWithLeadIDAndType(125, 2);
|
||||
Kint::dump($RFQdata['json']);
|
||||
$returnData = $LeadsController->getPlacementJson($data);
|
||||
$this->clientPolicyModel->where('id', 6050)->set('placement_json', $returnData)->update();
|
||||
dd($returnData);
|
||||
|
||||
// $data = $this->leadsModel->where('leads.id', 125)->where('leads.is_active', 1)->first();
|
||||
// $RFQdata = $RFQModel->getRFQTableDataWithLeadIDAndType(125, 2);
|
||||
// Kint::dump($RFQdata['json']);
|
||||
// $returnData = $LeadsController->getPlacementJson($data);
|
||||
// $this->clientPolicyModel->where('id', 6050)->set('placement_json', $returnData)->update();
|
||||
// dd($returnData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ class LeadsController extends BaseController
|
||||
{
|
||||
$data = $this->request->getPost();
|
||||
|
||||
if ($data['lead_type'] == 2) {
|
||||
if ($data['lead_type'] != 1) {
|
||||
$client_data = $this->clientModel->where('id', $data['client_id'])->where('is_active', 1)->first();
|
||||
$data['client_name'] = $client_data['client_name'];
|
||||
$data['client_short_name'] = $client_data['short_name'];
|
||||
@ -2449,6 +2449,24 @@ class LeadsController extends BaseController
|
||||
);
|
||||
}, $jsonArray);
|
||||
|
||||
if (!empty($proposalData)) {
|
||||
foreach ($proposalData['proposal_data']['over_all_column_data'] as $key => &$proposal) {
|
||||
// Keep only the required proposal
|
||||
if ($key !== $proposel_data['proposel_name']) {
|
||||
unset($proposalData['proposal_data']['over_all_column_data'][$key]);
|
||||
} else {
|
||||
// Within the matched proposal, filter insurers
|
||||
if (!empty($proposal['insurers'])) {
|
||||
$proposal['insurers'] = array_values(array_filter($proposal['insurers'], function ($insurer) use ($proposel_data) {
|
||||
return $insurer['display_name'] === $proposel_data['insurer_name'];
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($proposal); // Good practice after foreach by reference
|
||||
}
|
||||
|
||||
|
||||
$placement_json_data[] = $proposalData;
|
||||
|
||||
return json_encode($placement_json_data);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user