From f3ca9052ecec1f531a188c8a1d6f388c03b9bb71 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 22 Oct 2018 19:02:39 +0530 Subject: [PATCH] ENTITY --- api/application/config/constants.php | 2 +- .../Entity_Management_Controller.php | 2 +- api/application/models/PD_Model.php | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/api/application/config/constants.php b/api/application/config/constants.php index b79581e1..8d0def30 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', 'getEntityMasterInfo'); // no errors /*********************AWS resources Constants*************************************************/ defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); diff --git a/api/application/controllers/Entity_Management_Controller.php b/api/application/controllers/Entity_Management_Controller.php index dbd77e7a..86a06db6 100644 --- a/api/application/controllers/Entity_Management_Controller.php +++ b/api/application/controllers/Entity_Management_Controller.php @@ -31,7 +31,7 @@ class Entity_Management_Controller extends REST_Controller { if($this->get('sort')) { $sort = $this->get('sort'); } if($this->get('etid')) { $entity_type_id = $this->get('etid'); } - $result = $this->Entity_Management_Model->listAllEntities($page,$limit,$sort,$entity_type_id); + $result = $this->Entity_Management_Model->listAllEntities($page,$limit,$sort,$entity_type_id,$entity_id); if($result['data_status']) { $data['dataStatus'] = true; diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index c9ac0528..e90fb274 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -341,17 +341,17 @@ class PD_Model extends SPARQ_Model { public function getAnswersForPD($question_id,$pd_id,$template_id,$category_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,PDDETAIL.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(PDDETAIL.' as PDDETAIL',"QUESTIONANSWERS.question_answer_id = PDDETAIL.pd_answer_id AND PDDETAIL.fk_pd_id = $pd_id",'LEFT'); - // // $this->db->WHERE('QUESTIONANSWERS.fk_question_id',$question['question_id']); - // $this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_template_question_id',$question_id); - // //$this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_question_category_id',$category_id); - // //$this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_template_id',$template_id); - // // $this->db->WHERE('PDDETAIL.fk_pd_id',$pdid); - // $answers = $this->db->GET()->result_array(); - // print_r($answers); + $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,PDDETAIL.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(PDDETAIL.' as PDDETAIL',"QUESTIONANSWERS.question_answer_id = PDDETAIL.pd_answer_id AND PDDETAIL.fk_pd_id = $pd_id",'LEFT'); + // $this->db->WHERE('QUESTIONANSWERS.fk_question_id',$question['question_id']); + $this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_template_question_id',$question_id); + //$this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_question_category_id',$category_id); + //$this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_template_id',$template_id); + // $this->db->WHERE('PDDETAIL.fk_pd_id',$pdid); + $answers = $this->db->GET()->result_array(); + print_r($answers); } /**