PD ANSWERS CHNAGED

This commit is contained in:
velz 2018-10-22 20:16:43 +05:30
parent f3ca9052ec
commit 891221b6f6
4 changed files with 25 additions and 7 deletions

View File

@ -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', 'getEntityMasterInfo'); // no errors
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getAnswersForPD'); // no errors
/*********************AWS resources Constants*************************************************/
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');

View File

@ -24,7 +24,7 @@ class Entity_Management_Controller extends REST_Controller {
public function listAllEntites_get()
{
$page = 0;$limit = 0;$sort = 'ASC';$entity_type_id = '';
$page = 0;$limit = 0;$sort = 'ASC';$entity_type_id = '';$entity_id = '';
if($this->get('page')) { $page = $this->get('page'); }
if($this->get('limit')){ $limit = $this->get('limit'); }

View File

@ -1177,7 +1177,7 @@ class PD_Controller extends REST_Controller {
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $pd_detail_id;
$data['records'] = $answers;
$this->response($data,REST_Controller::HTTP_OK);
}
else

View File

@ -341,17 +341,35 @@ 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');
$pd_master_detials = $this->getPDMasterDetails($pd_id);
$this->db->SELECT('QUESTIONANSWERS.question_answer_id,QUESTIONANSWERS.answer,TEMPLATEANSWERWEIGHTAGE.template_answer_weightage,PDDETAIL.pd_detail_id,PDDETAIL.pd_anwer_image_title,PDDETAIL.pd_answer_image');
$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(TEMPLATEQUESTION." as TEMPLATEQUESTION","TEMPLATEANSWERWEIGHTAGE.fk_template_question_id = TEMPLATEQUESTION.template_question_id AND TEMPLATEQUESTION.fk_template_question_category_id = $category_id AND TEMPLATEQUESTION.fk_template_id = $template_id AND TEMPLATEQUESTION.fk_question_id = $question_id");
$this->db->JOIN(QUESTIONANSWERS.' as QUESTIONANSWERS','TEMPLATEANSWERWEIGHTAGE.fk_question_answer_id = QUESTIONANSWERS.question_answer_id');
$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_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);
if(count($answers))
{
$bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_detials[0]['fk_lender_id'];
foreach($answers as $answer_key => $answer)
{
if($answer['pd_answer_image'] != "" || $answer['pd_answer_image'] != null)
{
$profilepics3path = 'pd'.$pd_master_detials[0]['pd_id'].'/'.$answer['pd_answer_image'];
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$profilepics3path,'+30 minutes');
$answers[$answer_key]['doc_url'] = $singed_uri;
}
}
}
return $answers;
}
/**