city added in sales PD : ps
This commit is contained in:
parent
de62df0ec0
commit
e5b342f946
@ -198,7 +198,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
{
|
||||
|
||||
$all_section_data = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('sales_pd_id' => $sales_pd_id,'isactive' => 1),SALESPD_SECTION_DATA,array(),'','section_id','ASC');
|
||||
// print_r(json_decode($all_section_data[2]['section_data'],true));//die();
|
||||
// print_r(json_decode($all_section_data[0]['section_data'],true));die();
|
||||
$view_data['master'] = $sales_pd_data;
|
||||
foreach ($all_section_data as $sec_key => $section)
|
||||
{
|
||||
@ -278,7 +278,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$lender_id = $this->uri->segment(2);
|
||||
$user_id = $this->uri->segment(3);
|
||||
$role = $this->uri->segment(4);
|
||||
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type','SALES_PD_DATA.rand_string','SALES_PD_DATA.isactive',
|
||||
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type','SALES_PD_DATA.rand_string','SALES_PD_DATA.isactive','SALES_PD_DATA.city_id','CITY.name as city_name',
|
||||
'(CASE WHEN SALES_PD_DATA.status = "STARTED" THEN SALES_PD_DATA.createdon WHEN SALES_PD_DATA.status = "COMPLETED" THEN SALES_PD_DATA.completed_date ELSE NULL END) AS createdon'
|
||||
// ,"DATE_FORMAT(SALES_PD_DATA.createdon,'%Y-%m-%d') as modify","DATE_ADD(CURDATE(),INTERVAL '-10' DAY) as currd",
|
||||
// "(CURDATE()) as daye10"
|
||||
@ -291,6 +291,9 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
array('table' => PRODUCTS. ' as PRODUCT',
|
||||
'condition' =>'SALES_PD_DATA.product_id = PRODUCT.product_id',
|
||||
'jointype' => 'INNER'),
|
||||
array('table' => CITY. ' as CITY',
|
||||
'condition' =>'SALES_PD_DATA.city_id = CITY.city_id',
|
||||
'jointype' => 'LEFT'),
|
||||
array('table' => USERPROFILE. ' as USERPROFILE',
|
||||
'condition' =>'SALES_PD_DATA.createdby = USERPROFILE.userid',
|
||||
'jointype' => 'LEFT')
|
||||
@ -547,6 +550,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
$count = $this->Sales_PD_Model->selectCustomRecords(array('count(*) as count'),array('lender_id' => $records['lender_id'],'product_id' => $records['product_id'],'isactive' => 1),SALES_PD_DATA);
|
||||
|
||||
|
||||
// die();
|
||||
if($records['sales_pd_id'] == '' || $records['sales_pd_id'] == null)
|
||||
@ -768,6 +772,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
//update Applicant ID and applicant Name to sales pD master Table
|
||||
$applicant_id = null;
|
||||
$applicant_name = '';
|
||||
$city = '';
|
||||
if($records['questions'])
|
||||
{
|
||||
foreach ($records['questions'] as $g_key => $g_value)
|
||||
@ -781,12 +786,17 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
{
|
||||
$applicant_name = $g_value['answer_value'];
|
||||
}
|
||||
|
||||
if($g_value['question_key'] == 'city')
|
||||
{
|
||||
$city = $g_value['answer_value'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$update_fields = array('applicant_name' => $applicant_name,'applicant_id' => $applicant_id);
|
||||
$update_fields = array('applicant_name' => $applicant_name,'applicant_id' => $applicant_id,'city_id'=>$city);
|
||||
$this->Sales_PD_Model->updateRecords($update_fields,SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user