automation Sales PD Called : ps
This commit is contained in:
parent
7e0230f41f
commit
c703668383
@ -230,6 +230,15 @@ class SMC_Credit_PD_Controller extends REST_Controller {
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->SMC_Credit_PD_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SMC_CREDIT_PD,array('smc_credit_pd' => $smc_credit_pd));
|
$this->SMC_Credit_PD_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SMC_CREDIT_PD,array('smc_credit_pd' => $smc_credit_pd));
|
||||||
|
sleep(10);
|
||||||
|
$result = $this->dataSynchronization($smc_credit_pd);
|
||||||
|
log_message('ERROR', '#### Automation Credit PD ('.$smc_credit_pd.') status '.$result->status.' Data Transfered');
|
||||||
|
// $flag = $result == true ? $flag+1 : $flag;
|
||||||
|
if($result->status == 200){
|
||||||
|
log_message('ERROR', '#### Credit PD ('.$smc_credit_pd.') status '.$result->status." Data Transfered");
|
||||||
|
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||||
|
$this->SMC_Credit_PD_Model->updateRecords($update_fields2,PDTRIGGER,array('pd_id' => $smc_credit_pd));
|
||||||
|
}
|
||||||
if($api)
|
if($api)
|
||||||
{
|
{
|
||||||
// $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
// $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
||||||
@ -279,6 +288,9 @@ class SMC_Credit_PD_Controller extends REST_Controller {
|
|||||||
if(!empty($details)){
|
if(!empty($details)){
|
||||||
$response = $this->dataSynchronization($smc_credit_pd);
|
$response = $this->dataSynchronization($smc_credit_pd);
|
||||||
if($response){
|
if($response){
|
||||||
|
log_message('ERROR', '#### Credit PD ('.$smc_credit_pd.') status '.$response." Data Transfered");
|
||||||
|
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||||
|
$this->SMC_Credit_PD_Model->updateRecords($update_fields2,PDTRIGGER,array('pd_id' => $smc_credit_pd));
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
$data['status'] = REST_Controller::HTTP_OK;
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
$data['msg'] = 'Data Shared Successfully';
|
$data['msg'] = 'Data Shared Successfully';
|
||||||
@ -331,17 +343,18 @@ class SMC_Credit_PD_Controller extends REST_Controller {
|
|||||||
if(!empty($details)){
|
if(!empty($details)){
|
||||||
$flag = 0;$ids=array();
|
$flag = 0;$ids=array();
|
||||||
for ($i = 0; $i < count($details); $i++) {
|
for ($i = 0; $i < count($details); $i++) {
|
||||||
|
log_message('ERROR', "smcCreditPD inx = $i ".$smc_credit_pd);
|
||||||
$smc_credit_pd = $details[$i]['pd_id'];
|
$smc_credit_pd = $details[$i]['pd_id'];
|
||||||
// echo $smc_credit_pd;
|
// echo $smc_credit_pd;
|
||||||
$result = $this->dataSynchronization($smc_credit_pd);
|
$result = $this->dataSynchronization($smc_credit_pd);
|
||||||
// $flag = $result == true ? $flag+1 : $flag;
|
// $flag = $result == true ? $flag+1 : $flag;
|
||||||
if($result == true){
|
if($result->status == 200){
|
||||||
|
log_message('ERROR', '#### Credit PD ('.$smc_credit_pd.') status '.$result->status." Data Transfered");
|
||||||
$flag = $flag+1;
|
$flag = $flag+1;
|
||||||
array_push($ids, $smc_credit_pd);
|
array_push($ids, $smc_credit_pd);
|
||||||
//update here.
|
//update here.
|
||||||
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||||
$this->SMC_Credit_PD_Model->updateRecords($update_fields2,PDTRIGGER,array('pd_id' => $smc_credit_pd));
|
$this->SMC_Credit_PD_Model->updateRecords($update_fields2,PDTRIGGER,array('pd_id' => $smc_credit_pd));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
|
|||||||
@ -234,6 +234,16 @@ class Sales_PD_Controller extends REST_Controller {
|
|||||||
{
|
{
|
||||||
|
|
||||||
$this->Sales_PD_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
$this->Sales_PD_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||||
|
sleep(10);
|
||||||
|
$result = $this->dataSynchronization($sales_pd_id);
|
||||||
|
log_message('ERROR', '#### Automation CET Data Push Sales PD ('.$sales_pd_id.') status '.$result->status." Data Transfered");
|
||||||
|
if($result->status == 200){
|
||||||
|
log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') status '.$result->status." Data Transfered");
|
||||||
|
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||||
|
$this->Sales_PD_Model->updateRecords($update_fields2,SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||||
|
}else{
|
||||||
|
log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') status '.$result->status);
|
||||||
|
}
|
||||||
if($api)
|
if($api)
|
||||||
{
|
{
|
||||||
$_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
$_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
||||||
@ -283,6 +293,9 @@ class Sales_PD_Controller extends REST_Controller {
|
|||||||
if(!empty($details)){
|
if(!empty($details)){
|
||||||
$response = $this->dataSynchronization($sales_pd_id);
|
$response = $this->dataSynchronization($sales_pd_id);
|
||||||
if($response){
|
if($response){
|
||||||
|
log_message('ERROR', '#### Sales PD ('.$sales_pd_id.') status '.$response->status." Data Transfered");
|
||||||
|
$update_fields2 = array('is_the_data_transfer_cet' => 1);
|
||||||
|
$this->Sales_PD_Model->updateRecords($update_fields2,SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||||
$data['dataStatus'] = true;
|
$data['dataStatus'] = true;
|
||||||
$data['status'] = REST_Controller::HTTP_OK;
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
$data['msg'] = 'Data Shared Successfully';
|
$data['msg'] = 'Data Shared Successfully';
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class CET_CREDITPD
|
|||||||
$response = json_decode($result);
|
$response = json_decode($result);
|
||||||
log_message('ERROR',"CET APP CREDIT PDID (".$pdid.") response :".json_encode($response));
|
log_message('ERROR',"CET APP CREDIT PDID (".$pdid.") response :".json_encode($response));
|
||||||
curl_close( $ch );
|
curl_close( $ch );
|
||||||
return $response->status == 200 ? true : false;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
// multipart/form-data;
|
// multipart/form-data;
|
||||||
@ -84,7 +84,7 @@ class CET_CREDITPD
|
|||||||
curl_close( $ch );
|
curl_close( $ch );
|
||||||
unlink($file);
|
unlink($file);
|
||||||
// unlink($file_name_with_full_path);
|
// unlink($file_name_with_full_path);
|
||||||
return $response->status == 200 ? true : false;
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user