From f55debdf1d6d7c2ee0f3a895d89e4ac6e6cfed3d Mon Sep 17 00:00:00 2001 From: velz Date: Thu, 25 Oct 2018 16:19:36 +0530 Subject: [PATCH] PD PROCESS 7 --- api/application/config/constants.php | 2 +- api/application/controllers/PD_Controller.php | 2 +- api/application/models/PD_Model.php | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index c8a42285..0b15a4a7 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -87,7 +87,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto // define login route name for token verification //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllTemplates/:any)'); // no errors -defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getAnswersForPD'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'loadFullTemplate'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 27cd4e35..1e54ac13 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1346,7 +1346,7 @@ class PD_Controller extends REST_Controller { $category_id = $this->post('category_id'); $answers = $this->PD_Model->getAnswersForPD($question_id,$pd_id,$template_id,$category_id); - + if(count($answers)) { diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index d031a200..8b6fe29d 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -433,7 +433,7 @@ class PD_Model extends SPARQ_Model { foreach($questions as $answer_key => $question) { - $this->db->SELECT('QUESTIONANSWERS.question_answer_id,QUESTIONANSWERS.answer,TEMPLATEANSWERWEIGHTAGE.template_answer_weightage_id, TEMPLATEANSWERWEIGHTAGE.fk_template_question_id, TEMPLATEANSWERWEIGHTAGE.fk_question_answer_id, TEMPLATEANSWERWEIGHTAGE.template_answer_weightage,PDANSWER.pd_detail_answer_id,PDANSWER.fk_pd_detail_id'); + $this->db->SELECT('QUESTIONANSWERS.question_answer_id,QUESTIONANSWERS.answer,TEMPLATEANSWERWEIGHTAGE.template_answer_weightage_id, TEMPLATEANSWERWEIGHTAGE.fk_template_question_id, TEMPLATEANSWERWEIGHTAGE.fk_question_answer_id, TEMPLATEANSWERWEIGHTAGE.template_answer_weightage,PDANSWER.isactive,PDANSWER.pd_detail_answer_id,PDANSWER.fk_pd_detail_id'); $this->db->FROM(TEMPLATEANSWERWEIGHTAGE.' as TEMPLATEANSWERWEIGHTAGE'); $this->db->JOIN(QUESTIONANSWERS.' as QUESTIONANSWERS','TEMPLATEANSWERWEIGHTAGE.fk_question_answer_id = QUESTIONANSWERS.question_answer_id','LEFT'); $this->db->JOIN(PDANSWER." as PDANSWER","QUESTIONANSWERS.question_answer_id = PDANSWER.pd_answer_id AND TEMPLATEANSWERWEIGHTAGE.fk_question_answer_id = PDANSWER.pd_answer_id AND PDANSWER.isactive = 1 AND PDANSWER.fk_pd_id = $pdid",'LEFT'); @@ -494,6 +494,7 @@ class PD_Model extends SPARQ_Model { $where_condition_array = array('fk_pd_id'=>$pd_id,'fk_pd_detail_id'=> $pd_detail[0]['pd_detail_id']); $pd_docs = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDDOCUMENTS); + // print_r($pd_docs);die(); if(count($pd_docs)) { $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_detials[0]['fk_lender_id']; @@ -506,8 +507,9 @@ class PD_Model extends SPARQ_Model { $pd_docs[$doc_key]['doc_url'] = $singed_uri; } } - $overalldata['images'] = $pd_docs; + } + $overalldata['images'] = $pd_docs; } return $overalldata;