From eadc2d0cb97e5cc3d3e8e5ae7245ac4489094362 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 26 Aug 2022 11:45:35 +0530 Subject: [PATCH] Image primary Key added : ps --- api/application/controllers/Flyhi_Controller.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index 486c2635..367caf40 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -583,6 +583,7 @@ class Flyhi_Controller extends REST_Controller { { $photo_questions['questions'][$key]['answer_value'] = $selfie[0]['img']; $photo_questions['questions'][$key]['image_location'] = $selfie[0]['location']; + $photo_questions['questions'][$key]['image_id'] = $selfie[0]['doc_id']; //$photo_questions['questions'][$key]['answer_value'] = "CHNAGED"; } } @@ -601,6 +602,7 @@ class Flyhi_Controller extends REST_Controller { { $photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = $img_value['img']; $photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['image_location'] = $img_value['location']; + $photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['image_id'] = $img_value['doc_id']; //$photo_questions['questions'][$key]['questions_group'][$v_key]['questions'][0]['answer_value'] = "CHANGED"; unset($all_sales_pd_images[$img_key]); break; @@ -1174,6 +1176,10 @@ class Flyhi_Controller extends REST_Controller { } + if(!empty($records['img_id']) && $records['img_name'] != 'selfie_with_person_met'){ + $update_fields2 = array('isactive' => 0); + $this->Flyhi_Model->updateRecords($update_fields2,SALEPD_DOCS,array('doc_id'=>$records['img_id'])); + } $id = $this->Flyhi_Model->saveRecords($records,SALEPD_DOCS); if($id)