Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e351b25c23
@ -500,7 +500,7 @@ class EmployeeController extends AdminController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getExcelFileErrors($file_id, $retun_type)
|
public function getExcelFileErrors($file_id, $retun_type = null)
|
||||||
{
|
{
|
||||||
// $file_id = $this->request->uri->getSegment(3);
|
// $file_id = $this->request->uri->getSegment(3);
|
||||||
$empServiceController = new EmployeeServiceController();
|
$empServiceController = new EmployeeServiceController();
|
||||||
|
|||||||
@ -4472,6 +4472,8 @@ class EmployeeRestController extends AdminController
|
|||||||
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
|
->join('client_policy', 'employee_polices.client_policy_id = client_policy.id')
|
||||||
->where([
|
->where([
|
||||||
'employees.is_active' => 1,
|
'employees.is_active' => 1,
|
||||||
|
'employees.emp_status' => 'draft',
|
||||||
|
'employee_polices.status' => 'draft',
|
||||||
'employee_polices.is_active' => 1,
|
'employee_polices.is_active' => 1,
|
||||||
'client_policy.policy_type_id' => 2,
|
'client_policy.policy_type_id' => 2,
|
||||||
'employees.family_floater_key' => 'self',
|
'employees.family_floater_key' => 'self',
|
||||||
|
|||||||
@ -557,7 +557,7 @@ if (!function_exists('change_date_format')) {
|
|||||||
$date = DateTime::createFromFormat($source_format, $date_str);
|
$date = DateTime::createFromFormat($source_format, $date_str);
|
||||||
if (!$date) {
|
if (!$date) {
|
||||||
// throw new Exception("Invalid date string for source format: $source_format");
|
// throw new Exception("Invalid date string for source format: $source_format");
|
||||||
log_message('error', "❌ Date format error : Invalid date string | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}");
|
// log_message('error', "❌ Date format error : Invalid date string | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $date->format($output_format);
|
return $date->format($output_format);
|
||||||
@ -568,7 +568,7 @@ if (!function_exists('change_date_format')) {
|
|||||||
$date = DateTime::createFromFormat($source_format, $date_str);
|
$date = DateTime::createFromFormat($source_format, $date_str);
|
||||||
if (!$date) {
|
if (!$date) {
|
||||||
// throw new Exception("Invalid date string for source format: $source_format");
|
// throw new Exception("Invalid date string for source format: $source_format");
|
||||||
log_message('error', "❌ Date format error : Invalid date string | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}");
|
// log_message('error', "❌ Date format error : Invalid date string | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $date->format('Y-m-d'); // MySQL default format
|
return $date->format('Y-m-d'); // MySQL default format
|
||||||
@ -585,15 +585,15 @@ if (!function_exists('change_date_format')) {
|
|||||||
// If no format matches, throw an exception
|
// If no format matches, throw an exception
|
||||||
$allowed_placeholders = implode(', ', $allowed_formats);
|
$allowed_placeholders = implode(', ', $allowed_formats);
|
||||||
// throw new Exception("Invalid date string format. Allowed formats: $allowed_placeholders");
|
// throw new Exception("Invalid date string format. Allowed formats: $allowed_placeholders");
|
||||||
log_message(
|
// log_message(
|
||||||
'error',
|
// 'error',
|
||||||
"❌ Date format error: Invalid date string. Allowed formats: {$allowed_placeholders} | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}"
|
// "❌ Date format error: Invalid date string. Allowed formats: {$allowed_placeholders} | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}"
|
||||||
);
|
// );
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
// return "Error: " . $e->getMessage();
|
// return "Error: " . $e->getMessage();
|
||||||
log_message('error', "❌ Date format error: {$e->getMessage()} | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}");
|
// log_message('error', "❌ Date format error: {$e->getMessage()} | Params => date_str: {$date_str}, source_format: {$source_format}, output_format: {$output_format}");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user