CHANGE_ADD_ACM_ID_FTO_SERVICE_PERSON_ID

This commit is contained in:
VENKATESHWARAN 2025-12-04 15:55:19 +05:30
parent 172e4b026e
commit 983255baa4

View File

@ -5282,8 +5282,17 @@ class EmpDataServiceController extends BaseController
$action_type_string = "addition";
}
$user_data = db_connect()->table('user_profiles')->where('is_active', 1)->where('id', $lead_data['created_by'] ?? null)->get()->getRowArray();
// get the acm data for service person id
$acm_data = db_connect()->table('client_rm')->where('is_active', 1)->where('client_id', $policy_data['client_id'] ?? null)->where('level', 3) ->get() ->getRowArray();
$service_person_id = null;
if(!empty($acm_data)){
$service_person_id = $acm_data['user_id'] ?? null;
}else{
$service_person_id = $params['created_by'] ?? null;
}
// get the user data for salse person id
$user_data = db_connect()->table('user_profiles')->where('is_active', 1)->where('id', $lead_data['created_by'] ?? null)->get()->getRowArray();
$salse_person_id = null;
if(isset($lead_data['salse_person_id']) && !empty($lead_data['salse_person_id'])){
$salse_person_array = json_decode($lead_data['salse_person_id'] ?? '{}', true) ?? [];
@ -5337,7 +5346,7 @@ class EmpDataServiceController extends BaseController
'entry_from' => 2,
'sales_generated_by' => $salse_person_id,
'serviced_by' => $params['created_by'] ?? null,
'serviced_by' => $service_person_id,
];
$this->myLogger->logme("error", "Constructed policy transaction data: " . json_encode($policyTransactionData));