live fixed (bcoz pdf title changes missing) : ps

This commit is contained in:
sanjeev.p 2021-10-25 14:35:47 +05:30
parent 6ae0af9b52
commit 89f7359e03

View File

@ -232,6 +232,15 @@ class Sales_PD_Controller extends REST_Controller {
if($api)
{
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
## NEW KEY BECAUSE TITLE-RENAME
if(curl_init($singed_uri) !== false){ ##THERE IS NO FILE in NEW KEY means we using OLD KEY. So that using if Cond.
$old_pdf_name = strtolower(trim($sales_pd_data[0]['applicant_name']));
$old_pdf_name .= '-'.$sales_pd_data[0]['abbr'];
$old_pdf_name .= '-'.(date('dmY',strtotime($sales_pd_data[0]['completed_date'])));
$old_key = 'sales_pd/'.$sales_pd_id.'/'.$old_pdf_name.'.pdf';
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$old_key,'30 minutes');
}
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $singed_uri;