PD PROCESS 4

This commit is contained in:
velz 2018-10-25 13:22:11 +05:30
parent 80f12d3047
commit 3fb147b12a
4 changed files with 11 additions and 5 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', 'getVendorCityMap'); // 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

@ -453,6 +453,7 @@ class Entity_Management_Controller extends REST_Controller {
if($records['vendor_city_map_id'] != null || $records['vendor_city_map_id'] != "")
{
$where_condition_array = array('vendor_city_map_id' => $records['vendor_city_map_id']);
$vendor_city_map_id = $this->Entity_Management_Model->updateRecords($records,VENDORCITYMAP,$where_condition_array);
if($vendor_city_map_id != "" || $vendor_city_map_id != null){ $count++; }

View File

@ -1104,7 +1104,7 @@ class PD_Controller extends REST_Controller {
//Deactivate Old Answers
$fields = array('pd_detail_answer_id');
$where_condition_array = array('fk_pd_id' => $answer['fk_pd_id'],'fk_pd_detail_id' => $answer['fk_pd_detail_id']);
$old_answers = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENTITY);
$old_answers = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDANSWER);
foreach($old_answers as $old)
{
@ -1172,6 +1172,8 @@ class PD_Controller extends REST_Controller {
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
$image['pd_document_name'] = $tempdocname;
$image['fk_pd_detail_id'] = $record['pd_detail_id'];
$image['fk_pd_id'] = $record['fk_pd_id'];
$pd_document_id = $this->PD_Model->saveRecords($images,PDDOCUMENTS);
if($pd_document_id != "" || $pd_document_id != null){ $image_count++; }
@ -1268,7 +1270,9 @@ class PD_Controller extends REST_Controller {
if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200)
{
$image['pd_document_name'] = $tempdocname;
$answer['fk_pd_detail_id'] = $pd_detail_id;
$image['fk_pd_detail_id'] = $record['pd_detail_id'];
$image['fk_pd_id'] = $record['fk_pd_id'];
$pd_document_id = $this->PD_Model->saveRecords($images,PDDOCUMENTS);
if($pd_document_id != "" || $pd_document_id != null){ $image_count++; }

View File

@ -461,12 +461,13 @@ class PD_Model extends SPARQ_Model {
public function getAnswersForPD($question_id,$pd_id,$template_id,$category_id)
{
$pd_master_detials = $this->getPDMasterDetails($pd_id);
$this->db->SELECT('QUESTIONANSWERS.question_answer_id,QUESTIONANSWERS.answer,TEMPLATEANSWERWEIGHTAGE.template_answer_weightage,PDANSWER.pd_detail_answer_id,PDANSWER.isactive = 1');
$this->db->SELECT('QUESTIONANSWERS.question_answer_id,QUESTIONANSWERS.answer,TEMPLATEANSWERWEIGHTAGE.template_answer_weightage,PDANSWER.pd_detail_answer_id,PDANSWER.isactive');
$this->db->FROM(TEMPLATEANSWERWEIGHTAGE.' as TEMPLATEANSWERWEIGHTAGE');
$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(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 = $pd_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.fk_pd_id = $pd_id AND PDANSWER.isactive = 1",'LEFT');
// $this->db->WHERE('QUESTIONANSWERS.fk_question_id',$question['question_id']);
// $this->db->WHERE('TEMPLATEANSWERWEIGHTAGE.fk_template_question_id',$question_id);