EXIST CHECK CHANGED

This commit is contained in:
Velz2020 2019-11-02 13:07:50 +05:30
parent 085ed0e31a
commit 0c06abe312
2 changed files with 19 additions and 10 deletions

View File

@ -4854,7 +4854,7 @@ public function getPDFormDetailsJSON_post()
$key = 'pd'.$pdid.'/'.$main_applicant_name.'_'.$pdid.'_'.'pd_images.zip'; $key = 'pd'.$pdid.'/'.$main_applicant_name.'_'.$pdid.'_'.'pd_images.zip';
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); //$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes');
if($pd_master_details[0]['is_zip_created']) if($pd_master_details[0]['is_zip_created'])
{ {
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes');
@ -9164,9 +9164,11 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
public function checkExistPDDetails_post() public function checkExistPDDetails_post()
{ {
$records = $this->post('records'); $records = $this->post('records');
//print_r($records);die(); $client = $this->post('client');
$lender_applicant_id = isset($records['lender_applicant_id']) ? $records['lender_applicant_id'] : null; $lender_applicant_id = isset($records['lender_applicant_id']) ? $records['lender_applicant_id'] : null;
$applicant_name = isset($records['applicant_name']) ? $records['applicant_name'] : null; $applicant_name = isset($records['applicant_name']) ? strtolower(trim($records['applicant_name'])) : null;
$mobile_no = isset($records['mobile_no']) ? $records['mobile_no'] : null; $mobile_no = isset($records['mobile_no']) ? $records['mobile_no'] : null;
$params = array(); $params = array();
$table = null; $table = null;
@ -9188,7 +9190,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$table = PDAPPLICANTSDETAILS; $table = PDAPPLICANTSDETAILS;
} }
$result_data = $this->PD_Model->checkExistPDDetails($params,$table); $result_data = $this->PD_Model->checkExistPDDetails($params,$table,$client);
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $result_data; $data['records'] = $result_data;

View File

@ -1867,7 +1867,7 @@ class PD_Model extends SPARQ_Model {
} }
function checkExistPDDetails($params,$table) function checkExistPDDetails($params,$table,$client)
{ {
if(count($params) && $table) if(count($params) && $table)
{ {
@ -1889,14 +1889,21 @@ class PD_Model extends SPARQ_Model {
if(isset($params['applicant_name']) && $params['applicant_name']) if(isset($params['applicant_name']) && $params['applicant_name'])
{ {
$where_condition_array['applicant_name'] = $params['applicant_name']; $where_condition_array['lower(trim(applicant_name))'] = $params['applicant_name'];
} }
$joins = array( $joins = array(
array('table'=>PDTRIGGER.' as PDTRIGGER','condition'=>'PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id','jointype'=>'LEFT'), array('table'=>PDTRIGGER.' as PDTRIGGER','condition'=>'PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id AND PDAPPLICANTSDETAILS.applicant_type = 1' ,'jointype'=>'INNER JOIN')
); );
return $this->getJoinRecords($fields,$table,$joins,$where_condition_array); if($client)
//print_r($this->db->last_query()); {
$joins = array(
array('table'=>PDTRIGGER." as PDTRIGGER",'condition'=>"PDAPPLICANTSDETAILS.fk_pd_id = PDTRIGGER.pd_id AND PDAPPLICANTSDETAILS.applicant_type = 1 AND PDTRIGGER.fk_lender_id = $client" ,"jointype"=>"INNER JOIN")
);
}
return
$this->getJoinRecords($fields,$table,$joins,$where_condition_array);
print_r($this->db->last_query());
} }
} }
else else