FIX_ISSUE

This commit is contained in:
VENKATESHWARAN 2026-02-04 10:20:19 +05:30
parent 69f9e24f3e
commit 44ec953af4

View File

@ -846,14 +846,16 @@ class EmployeeRestController extends AdminController
$responce = $employeeController->employeesUplodWithEvents($post_data); $responce = $employeeController->employeesUplodWithEvents($post_data);
// print_r($responce); die; // print_r($responce); die;
if(!$responce['status']){ return $responce;
$file_data = $this->getDataFromFilesTable(['file_id' => $responce['file_id']]);
$responce['data'] = $file_data; // if(!$responce['status']){
return $this->respond($responce, 200); // $file_data = $this->getDataFromFilesTable(['file_id' => $responce['file_id']]);
}else{ // $responce['data'] = $file_data;
$responce['data'] = []; // return $this->respond($responce, 200);
return $this->respond($responce, 200); // }else{
} // $responce['data'] = [];
// return $this->respond($responce, 200);
// }
@ -1273,7 +1275,11 @@ class EmployeeRestController extends AdminController
} }
if (isset($search_data['client_id']) && !empty($search_data['client_id'])) { if (isset($search_data['client_id']) && !empty($search_data['client_id'])) {
$builder->where("files.client_id", $search_data['client_id']); if (is_string($search_data['client_id']) && preg_match('/^[a-f0-9]{32}$/i', $search_data['client_id'])) {
$builder->where("MD5(files.client_id)", $search_data['client_id']);
} else {
$builder->where("files.client_id", $search_data['client_id']);
}
} }
if (isset($search_data['file_id']) && !empty($search_data['file_id'])) { if (isset($search_data['file_id']) && !empty($search_data['file_id'])) {
@ -4263,6 +4269,28 @@ class EmployeeRestController extends AdminController
public function hrFileList() public function hrFileList()
{ {
try { try {
$request = service('request');
$search_data = $request->getGetPost() ?? [];
// Fetch results
$data = $this->getDataFromFilesTable($search_data);
return $this->respond([
'status' => true,
'message' => 'File list fetched successfully',
'data' => $data
]);
} catch (\Exception $e) {
return $this->failServerError($e->getMessage());
}
}
public function hrFileListOld()
{
try {
$request = service('request'); $request = service('request');
$builder = $this->hrFileUploadModel; $builder = $this->hrFileUploadModel;