getAdditionalRequirements api changes : ps

This commit is contained in:
sanjeev 2021-12-06 10:06:29 +05:30
parent bebdce554d
commit b9b528f480
2 changed files with 33 additions and 18 deletions

View File

@ -11367,13 +11367,25 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
function getAdditionalRequirements_get(){ function getAdditionalRequirements_get(){
$pdid = $this->get('pdid'); $pdid = $this->get('pdid');
$pd_additional_requirements = $this->PD_Model->getPDAdditionalRequirements($pdid); if(!isset($pdid) && empty($pdid)){
if(!empty($pd_additional_requirements)) $data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NOT_FOUND;
$data['msg'] = 'PDID Not Found! Try again';
}
$result_data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
$result_data['docs_to_be_collected'] = $this->PD_Model->getDocsToBeCollected($pdid);
if(!empty($result_data))
{ {
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $pd_additional_requirements; $data['records'] = $result_data;
} }
else if(empty($result_data['pd_additional_requirements']) && empty($result_data['docs_to_be_collected']))
{
$data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NOT_FOUND;
$data['msg'] = 'Data Not Found';
}
else else
{ {
$data['dataStatus'] = false; $data['dataStatus'] = false;

View File

@ -120,15 +120,16 @@ class PD_Model extends SPARQ_Model {
//$this->db->WHERE("if(vendor_status = 'TRIGGERED', if( pd_status in ('ALLOCATED'),1,0),0)=0"); //$this->db->WHERE("if(vendor_status = 'TRIGGERED', if( pd_status in ('ALLOCATED'),1,0),0)=0");
} }
if($is_smc_vendor == true && $status != "" || $status != null){ if($status != "" || $status != null){
$this->db->WHERE('PDTRIGGER.vendor_status',strtoupper($status)); if($is_smc_vendor == true){
}else{ // echo "in IF";
if($status != "" || $status != null) $this->db->WHERE('PDTRIGGER.vendor_status',strtoupper($status));
{ }else{
$this->db->WHERE('PDTRIGGER.pd_status',strtoupper($status)); // echo "in ELSE";
$this->db->WHERE('PDTRIGGER.pd_status',strtoupper($status));
}
} }
} // die();
if($datetype != "" || $datetype != null) if($datetype != "" || $datetype != null)
{ {
if($datetype == 1) if($datetype == 1)
@ -275,13 +276,15 @@ class PD_Model extends SPARQ_Model {
} }
if($is_smc_vendor == true && $pd_status != "" || $pd_status != null){ if(!empty($pd_status)){
$this->db->WHERE('PDTRIGGER.vendor_status',$status); if($is_smc_vendor == true){
}else{ // if($is_smc_vendor == true && $pd_status != "" || $pd_status != null){
if(!empty($pd_status)) // echo "in IF";
{ $this->db->WHERE('PDTRIGGER.vendor_status',$status);
$this->db->WHERE_IN('PDTRIGGER.pd_status',$pd_status); }else{
} // echo "in ELSE";
$this->db->WHERE_IN('PDTRIGGER.pd_status',$pd_status);
}
} }
if(($pd_from_date != "" || $pd_from_date != null) && ($pd_to_date != "" || $pd_to_date != null)) if(($pd_from_date != "" || $pd_from_date != null) && ($pd_to_date != "" || $pd_to_date != null))
{ {