ENTITY REGION SAVE
This commit is contained in:
parent
18e67795df
commit
b3420ec6fd
@ -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', 'getCityHierarchy'); // no errors
|
||||
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'saveEntityRegionMapping'); // no errors
|
||||
|
||||
/*********************AWS resources Constants*************************************************/
|
||||
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');
|
||||
|
||||
@ -124,6 +124,7 @@ $route['getLocationHierarchy'] = 'Entity_Management_Controller/getLocationHierar
|
||||
$route['getEntityMasterInfo'] = 'Entity_Management_Controller/getEntityMasterInfo';
|
||||
$route['saveEntityBillingInfo'] = 'Entity_Management_Controller/saveEntityBillingInfo';
|
||||
$route['getCityHierarchy'] = 'Entity_Management_Controller/getCityHierarchy';
|
||||
$route['saveEntityRegionMapping'] = 'Entity_Management_Controller/saveEntityRegionMapping';
|
||||
|
||||
//PD RELATED
|
||||
$route['triggerNewPD'] = 'PD_Controller/triggerNewPD';
|
||||
|
||||
@ -371,24 +371,44 @@ class Entity_Management_Controller extends REST_Controller {
|
||||
* Save Entity Regions Mapping
|
||||
, //fk_region_id, fk_city_id, fk_entity_id, createdon, fk_createdby, updatedon, fk_updatedby
|
||||
*/
|
||||
public function SaveEntityRegionMapping_post()
|
||||
public function saveEntityRegionMapping_post()
|
||||
{
|
||||
// $records = $this->post('records');
|
||||
$count = 0;
|
||||
$records = $this->post('records');
|
||||
|
||||
foreach($records as $key => $record)
|
||||
{
|
||||
|
||||
if($record['entity_region_map_id'] != null || $record['entity_region_map_id'] != "")
|
||||
{
|
||||
|
||||
$where_condition_array = array('entity_region_map_id' => $record['entity_region_map_id']);
|
||||
$entity_region_map_id = $this->Entity_Management_Model->updateRecords($record,ENTITYREGION,$where_condition_array);
|
||||
if($entity_region_map_id != "" || $entity_region_map_id != null){ $count++; }
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$entity_region_map_id = $this->Entity_Management_Model->saveRecords($record,ENTITYREGION);
|
||||
if($entity_region_map_id != "" || $entity_region_map_id != null){ $count++; }
|
||||
}
|
||||
}
|
||||
|
||||
if(count($records) == $count)
|
||||
{
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = true;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data['dataStatus'] = false;
|
||||
$data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
|
||||
$data['msg'] = 'Records Not Found';
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
// foreach($records as $key => $record)
|
||||
// {
|
||||
// if($record['entity_region_map_id'] != "" || $record['entity_region_map_id'] != null)
|
||||
// {
|
||||
// $where_condition_array = array('entity_region_map_id' => $record['entity_region_map_id']);
|
||||
// $entity_region_map_id = $this->Entity_Management_Model->updateRecords($record,ENTITYREGION,$where_condition_array);
|
||||
// if($entity_region_map_id != "" || $entity_region_map_id != null){ $count++; }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// $entity_region_map_id = $this->Entity_Management_Model->saveRecords($record,ENTITYREGION,$where_condition_array);
|
||||
// if($entity_region_map_id != "" || $entity_region_map_id != null){ $count++; }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -325,7 +325,7 @@ class PD_Model extends SPARQ_Model {
|
||||
}
|
||||
}
|
||||
|
||||
//$result_data['child'] = array('Hi'=>'Welcome');
|
||||
$result_data['child'] = array('testkey'=>'testvalue');
|
||||
$result_data['master'] = $actual_logs;
|
||||
|
||||
// Child History Start
|
||||
|
||||
Loading…
Reference in New Issue
Block a user