From 347dbde7e9ac51d48eaa4c9b7c76d2821591c32e Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 26 Jul 2022 19:49:55 +0530 Subject: [PATCH] VideoStatus : ps --- api/application/controllers/PD_Controller.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 9cca18f8..83a18022 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -10250,7 +10250,12 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() $this->load->library('twlio'); $result_data = 0; // $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id and twilo_status = 'enqueued' and composition_id is not null;"; - $pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id,$random_string); + if($pd_category == "1"){ + $pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id,$random_string); + }else{ + $pd_master_details = $this->PD_Model->selectCustomRecords(array('sales_pd_id as pd_id', 'lender_id as fk_lender_id', 'product_id', 'sales_pd_type','isactive', 'rand_string as random_string', 'pd_branch_id'),array('sales_pd_id' => $pd_id,'rand_string'=>$random_string),SALES_PD_DATA); + } + $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id and isactive = 1 and is_uploaded = 0 and pd_category = $pd_category";// and twilo_status = 'enqueued' and composition_id is not null;"; if($room_id) { @@ -10264,14 +10269,14 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() foreach ($video_info as $key => $value) { - if($value['composition_id'] && $value['vps'] != 'google') + if($value['composition_id'] && $value['vsp'] != 'google') { $res = $this->twlio->getCompositionStatus($value['composition_id']); //echo $res['status']; if(count($res) && $res['status'] == 'completed') { - $is_copied = $this->copyMediaFromTwiloToS3($pd_master_details,$value);// copy media from twlio s3 to our s3 + $is_copied = $this->copyMediaFromTwiloToS3($pd_master_details,$value,$pd_category);// copy media from twlio s3 to our s3 $fields_to_update = array('twilo_status' => 'completed'); if($is_copied) { $fields_to_update['s3_copied'] = 1; } $id = $this->PD_Model->updateRecords($fields_to_update,VIDEO_ROOM_INFO,array('video_room_info_id' => $value['video_room_info_id'])); @@ -10313,7 +10318,7 @@ public function getCompaniesListsFromGeneralFormRawJSONV2_post() $singed_uri = $this->twlio->compositionVideoFile($value['composition_id']); //echo $singed_uri; $file_folder = $pd_catgory == "2" ? "sales_pd" : "pd_reports" ; - $lender_id = $pd_catgory == "1" ? $pd_master_details[0]['fk_lender_id'] : $pd_master_details[0]['lender_id']; + $lender_id = $pd_master_details[0]['fk_lender_id']; $internal_server_tmp_location = XLPATH.'/'.$file_folder.'/'.$pd_master_details[0]['pd_id'].'/videos'; $internal_server_tmp_location_filename = ($internal_server_tmp_location.'/'.$value['composition_id'].'.mp4'); //echo $internal_server_tmp_location;