delete video api : ps

This commit is contained in:
Sanjeev 2021-07-02 15:46:51 +05:30
parent c213601492
commit 792ff79582
2 changed files with 21 additions and 17 deletions

View File

@ -9780,14 +9780,19 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
} }
// To Inactive Video Recorded. // To Inactive Video Recorded.
public function deleteVideo_post(){ public function deleteVideo_get(){
$multipleWhere = $this->post(); $id = $this->get('id');
$multipleWhere['fk_pd_id'] = $multipleWhere['pd_id']; $id = (int) $id;
unset($multipleWhere['pd_id']); if(!empty($id)){
$this->load->helper('video_grabber_helper'); // $multipleWhere['fk_pd_id'] = $multipleWhere['pd_id'];
$result_data = (new video_grabber_helper)->deleteVideo($multipleWhere); // unset($multipleWhere['pd_id']);
$this->load->helper('video_grabber_helper');
$result_data = (new video_grabber_helper)->deleteVideo($id);
}else{
$result_data = "ID Not Available. Unable to Delete";
}
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;
$data['msg'] = $result_data ; $data['msg'] = $result_data ;

View File

@ -35,11 +35,11 @@ class video_grabber_helper
{ {
$final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name; $final_key = 'pd'.$pd_master_details[0]['pd_id'].'/video/'.$file_name;
$singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days'); $singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$final_key,'+7 days');
$result_data[] = array('video_name' => $video_name,'url' => $singed_uri,'status' => $value['twilo_status'],'room_id' => $value['room_id']); $result_data[] = array('video_name' => $video_name,'url' => $singed_uri,'status' => $value['twilo_status'],'room_id' => $value['room_id'],'id' => $value['video_room_info_id']);
} }
else else
{ {
$result_data[] = array('video_name' => $video_name, 'url' => '','status' =>'processing','room_id' => $value['room_id']); $result_data[] = array('video_name' => $video_name, 'url' => '','status' =>'processing','room_id' => $value['room_id'],'id' => $value['video_room_info_id']);
} }
} }
@ -49,15 +49,14 @@ class video_grabber_helper
return $result_data; return $result_data;
} }
public function deleteVideo($multipleWhere) public function deleteVideo($id)
{ {
$CI =&get_instance(); $CI =&get_instance();
$updateRows = array('isactive' => 0); $updateRows = array('isactive' => 0);
// $multipleWhere = array('fk_pd_id' => $pdid, 'room_id' => $roomid); $CI->db->where('video_room_info_id =',$id);
$CI->db->where($multipleWhere); $CI->db->update(VIDEO_ROOM_INFO, $updateRows);
$CI->db->update(VIDEO_ROOM_INFO, $updateRows); $affectedRows = $CI->db->affected_rows();
$affectedRows = $CI->db->affected_rows(); return (($affectedRows > 0 ) ? "Deleted successfully" : "Fail to Delete");
return (($affectedRows > 0 ) ? "Deleted successfully" : "Fail to Delete");
} }
} }