From 6fb171466194598520873a98f42100943b3a2c08 Mon Sep 17 00:00:00 2001 From: velz Date: Thu, 18 Oct 2018 15:23:47 +0530 Subject: [PATCH] TEMPLATE --- api/application/config/constants.php | 2 +- api/application/models/PD_Model.php | 4 +++- api/application/models/Template_Management_Model.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index d0b30948..77bdcc05 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', 'getTemplateQuestionAnswers'); // no errors +defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getQuestionsForTemplateCreation'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 31265e64..930b89cb 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -293,6 +293,7 @@ class PD_Model extends SPARQ_Model { // $this->db->JOIN(USERPROFILE.' as USERPROFILE1','TEMPLATEQUESTION.fk_updatedby = USERPROFILE1.userid','LEFT'); $this->db->WHERE('TEMPLATEQUESTION.fk_template_question_category_id',$category['fk_question_category_id']); $this->db->WHERE('TEMPLATEQUESTION.fk_template_id',$template_id); + $questions = $this->db->GET()->result_array(); @@ -304,7 +305,8 @@ class PD_Model extends SPARQ_Model { $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, TEMPLATEANSWERWEIGHTAGE.isactive'); $this->db->FROM(TEMPLATEANSWERWEIGHTAGE.' as TEMPLATEANSWERWEIGHTAGE'); $this->db->JOIN(QUESTIONANSWERS.' as QUESTIONANSWERS','TEMPLATEANSWERWEIGHTAGE.fk_question_answer_id = QUESTIONANSWERS.question_answer_id','LEFT'); - $this->db->WHERE('QUESTIONANSWERS.fk_question_id',$question['question_id']); + // $this->db->WHERE('QUESTIONANSWERS.fk_question_id',$question['question_id']); + $this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_template_question_id',$question['template_question_id']); $answers = $this->db->GET()->result_array(); $questions[$answer_key]['answers'] = $answers; } diff --git a/api/application/models/Template_Management_Model.php b/api/application/models/Template_Management_Model.php index 6820c923..c589583a 100644 --- a/api/application/models/Template_Management_Model.php +++ b/api/application/models/Template_Management_Model.php @@ -156,7 +156,7 @@ class Template_Management_Model extends SPARQ_Model { $fields = array('fk_question_id'); $where_condition_array = array('fk_template_question_category_id' => $category_id,'fk_template_id' => $template_id); $result_data = $this->selectCustomRecords($fields,$where_condition_array,TEMPLATEQUESTION); - + // print_r($result_data); if(count($result_data)) { $temp_array = array(); @@ -207,7 +207,7 @@ class Template_Management_Model extends SPARQ_Model { // $this->db->JOIN(USERPROFILE.' as USERPROFILE','TEMPLATEQUESTION.fk_createdby = USERPROFILE.userid','LEFT'); // $this->db->JOIN(USERPROFILE.' as USERPROFILE1','TEMPLATEQUESTION.fk_updatedby = USERPROFILE1.userid','LEFT'); $this->db->WHERE('QUESTIONS.fk_question_category',$category_id); - $this->db->WHERE('TEMPLATEQUESTION.fk_template_id',$template_id); + //$this->db->WHERE('TEMPLATEQUESTION.fk_template_id',$template_id); $questions = $this->db->GET()->result_array(); if(count($questions)) {