From 9124a8792d30f7d81b133ab495e6f38c06cc14c0 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 1 Jul 2024 14:24:56 +0530 Subject: [PATCH] FIX_CLIENT_UPLOAD_VALIDATION_ISSUE --- app/Controllers/EmployeeRestController.php | 34 +++++++++---------- app/Controllers/EmployeeServiceController.php | 2 +- app/Helpers/excel_util_helper.php | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/Controllers/EmployeeRestController.php b/app/Controllers/EmployeeRestController.php index 5540381a..7e5e0937 100644 --- a/app/Controllers/EmployeeRestController.php +++ b/app/Controllers/EmployeeRestController.php @@ -27,7 +27,7 @@ use App\Models\NotificationModel; use App\Models\UserModel; use App\Models\FEContentModel; use App\Models\AddImgModel; -use App\Models\FileModel; + use App\Controllers\Jobs ; @@ -668,7 +668,7 @@ class EmployeeRestController extends AdminController $file_name_with_path = WRITEPATH."/uploads/excel/".$filename; //make an entry in DB - $file_id = $this->fileModel->insert(['file_name' => $filename, 'client_id' => $client_id, 'policy_id' => $policy_id, 'created_by' => $loggedInUserID, 'status' => $status, 'action' => 'enrollment', 'client_branch_id' => $client_branch_id]); //here field policy_id have client_policy_id and not policy id from policy master + $file_id = $this->fileModel->insert(['file_name' => $filename, 'client_id' => $client_id, 'policy_id' => $policy_id, 'created_by' =>$employee_id, 'status' => 'inprogress', 'action' => 'enrollment', 'client_branch_id' => $client_branch_id]); //here field policy_id have client_policy_id and not policy id from policy master $this->myLogger->logme("error", '{file_id} - client uploaded success', ['file_id' => $file_id]); $empServiceController = new EmployeeServiceController(); @@ -712,23 +712,23 @@ class EmployeeRestController extends AdminController $file_data =$this->fileModel->insert($extractData); $extra = []; - if (count($data[0]) == 11) { - $value = ['Sno','Emp_Code','Name','DOJ','Gender','Relation','DOB','Mail','Mobile','SI','Grade']; - $check_miss_match = []; - for ($i=0; $i 0) { - return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 200); - } - } + // if (count($check_miss_match) > 0) { + // return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Column Name's are miss Match's!", 'data'=> $check_miss_match], 200); + // } + // } - if(count($data[0]) != 11){ - return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 200); - } + // if(count($data[0]) != 11){ + // return $this->respond(['status' => 'failed', 'code' => 404, 'message' => "Uploaded file row count is Not Match!" ], 200); + // } //this change the column name into index number for ($i = 0; $i < count($data[0]); $i++) { diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index c351d0b1..d5b65670 100644 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -873,7 +873,7 @@ class EmployeeServiceController extends AdminController $job_details = new Jobs(); $r = Jobs::addJob(['job_name' => 'excelFileDataValidation','payload' => ['file_id' => $file_id]]); // $jobWorker = new JobWorker(); - // JobWorker::processJob($r);s + // JobWorker::processJob($r); } return $result; diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 11f9a5ee..a3e4369d 100644 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -632,7 +632,7 @@ if (!function_exists('check_dependent_conflict')) } } //check for any cross parents but not more than two - if($allowed_adults == 0 && $allowed_parents_count == 1 && $allowed_parent_in_laws_count == 1 && (2 < ($received_parents_count + $received_parent_in_laws_count))) + if($allowed_adults == 2 && (2 < ($received_parents_count + $received_parent_in_laws_count))) { // dd($allowed_adults); $result['status'] = false;