CET satellite fixes : ps

This commit is contained in:
VE10-Sanjeev 2023-08-11 15:55:23 +05:30
parent 5e97fed413
commit 06dd6d7a3a
2 changed files with 19 additions and 6 deletions

View File

@ -1584,7 +1584,7 @@ public function filterSalesPDList_post() {
$input_data = $this->post();
log_message('ERROR','####Satellite IMG CALLED smc credit pd ='.$input_data['smc_credit_pd']);
$id = $this->SMC_Credit_PD_Model->updateRecords($input_data,SMC_CREDIT_PD,array('smc_credit_pd' => $input_data['smc_credit_pd']));
satellite_image::getSatelliteImage($input_data['smc_credit_pd'],2);
satellite_image::getSatelliteImage($input_data['smc_credit_pd'],3);
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
@ -2698,11 +2698,11 @@ public function filterSalesPDList_post() {
function auditGCPFile_get(){
$this->load->library('Googlecloud');
$bk_name1= 'sales-pd';
$bk_name2= 'sales-pd-demo';
$prefix = $this->get('prefix');
//$prefix = 'credit-pd-demo/pd17092/';
$prefix = 'credit-pd/pd18010/images/stock_image_ELawVP.png';
// $bk_name1= 'sales-pd';
// $bk_name2= 'sales-pd-demo';
// $prefix = $this->get('prefix');
$prefix = 'credit-pd-demo/pd17092/';
$prefix = 'credit-pd/pd18910/images/satellite.png';
$data['prefix'] = $prefix;
// $data['listAllBuckets'] = $this->googlecloud->listAllBuckets();

View File

@ -144,6 +144,19 @@ class satellite_image
{
//echo 'updae';
$satellite_base64 = base64_encode(file_get_contents($satellite_image_png_path));
// Google Library - GCP
$CI->load->library('Googlecloud');
$gcpBucketName = GCP_BUCKET_NAME;
$prefixToObject = ENVIRONMENT == 'production' ? "credit-pd":"credit-pd-demo";
$gcpObjectName = $prefixToObject."/pd".$pdid."/images/satellite.png";
$result = $CI->googlecloud->uploadFileToGCPBucket($gcpBucketName,$gcpObjectName,$satellite_image_png_path);
if($result == true){
log_message('ERROR', '### smc-credit-PD ('.$pdid.') Satellite Image Stored In GCP ');
}else{
log_message('ERROR', '### smc-credit-PD ('.$pdid.') Satellite Image Not Stored In GCP');
}
$CI->PD_Model->updateRecords(array('isactive' => 0),SMC_CREDIT_PD_DOCS,array('img_name' => 'satellite','fk_smc_credit_pd_id' => $pd_id));
$CI->PD_Model->saveRecords(array('img' => $satellite_base64,'img_name' => 'satellite','fk_smc_credit_pd_id' => $pd_id),SMC_CREDIT_PD_DOCS);
}