FIX_ISSUE
This commit is contained in:
parent
ffec0fef10
commit
1e4e0c6087
@ -5442,7 +5442,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
if(empty($cd_data)){
|
if(empty($cd_data)){
|
||||||
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No Client Deposit data found for cd_ac_pk=' . $cd_ac_pk);
|
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No Client Deposit data found for cd_ac_pk=' . $cd_ac_pk);
|
||||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found'], 200);
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found', 'data' => []], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
$client_policy_data = $this->clientPolicyModel
|
$client_policy_data = $this->clientPolicyModel
|
||||||
@ -5452,7 +5452,7 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
if(empty($client_policy_data)){
|
if(empty($client_policy_data)){
|
||||||
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No Client Policy data found for client_policy_id=' . $cd_data['client_policy_id']);
|
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No Client Policy data found for client_policy_id=' . $cd_data['client_policy_id']);
|
||||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found'], 200);
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found', 'data' => []], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
$policyTransactionModel = new PolicyTransactionModel();
|
$policyTransactionModel = new PolicyTransactionModel();
|
||||||
@ -5460,37 +5460,23 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
if(empty($policy_transaction_data)){
|
if(empty($policy_transaction_data)){
|
||||||
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No Policy Transaction data found for policy_no=' . $client_policy_data['policy_no']);
|
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No Policy Transaction data found for policy_no=' . $client_policy_data['policy_no']);
|
||||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found'], 200);
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found', 'data' => []], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
$policy_transaction_ids = array_column($policy_transaction_data, 'id');
|
$policy_transaction_ids = array_column($policy_transaction_data, 'id');
|
||||||
|
|
||||||
|
|
||||||
$ptFilesModel = new PTFileModel();
|
$ptFilesModel = new PTFileModel();
|
||||||
$pt_files_data = $ptFilesModel->where('is_active', 1)->whereIn('policy_transaction_id', $policy_transaction_ids)->findAll();
|
$pt_files_data = $ptFilesModel->where('is_active', 1)->whereIn('pt_id', $policy_transaction_ids)->findAll();
|
||||||
|
|
||||||
if(empty($pt_files_data)){
|
if(empty($pt_files_data)){
|
||||||
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No PT Files data found for pt_ids=' . implode(',', $policy_transaction_ids));
|
$this->myLogger->logme('error', 'getPolicyAndEndorsementFiles: No PT Files data found for pt_ids=' . implode(',', $policy_transaction_ids));
|
||||||
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found'], 200);
|
return $this->respond(['status' => false, 'code' => 404, 'message' => 'No file found', 'data' => []], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
return $this->respond(['status' => true, 'code' => 200, 'message' => 'Files found', 'data' => $pt_files_data], 200);
|
||||||
|
|
||||||
// construct the policy file list
|
|
||||||
private function constructPtFileToDownloadableLinks($data)
|
|
||||||
{
|
|
||||||
$file_list = [];
|
|
||||||
foreach ($data as $key => $value) {
|
|
||||||
$file_list[] = [
|
|
||||||
'id' => $value['id'],
|
|
||||||
'pt_id' => $value['pt_id'],
|
|
||||||
'file_name' => $value['file_name'],
|
|
||||||
'doc_name' => $value['doc_name'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $file_list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// download policy file
|
// download policy file
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user