CHANGE_HR_EMPLOYEE_LIST_THE_INACTIVE_EMP
This commit is contained in:
parent
02aaa6b493
commit
4a66b3a67e
@ -784,10 +784,10 @@ class ClientController extends AdminController
|
||||
],
|
||||
|
||||
'cd_ac_no' => [
|
||||
'rules' => 'required|is_natural_no_zero',
|
||||
'rules' => 'required|regex_match[/^[a-zA-Z0-9\/_\\-]+$/]',
|
||||
'errors' => [
|
||||
'required' => 'Account number is required',
|
||||
'is_natural_no_zero' => 'must be a positive integer',
|
||||
'regex_match' => 'Account number can only contain letters, numbers, slashes (/), underscores (_), and hyphens (-)',
|
||||
]
|
||||
],
|
||||
|
||||
|
||||
@ -607,7 +607,7 @@ class EmployeeRestController extends AdminController
|
||||
{
|
||||
try {
|
||||
|
||||
$empData = $this->employeePolicyModel->getEmployeePolicy(client_id: $this->request->getGet('client_id'), policy_id: $this->request->getGet('client_policy_id'), status: 0, branch_id: $this->request->getGet('client_branch_id'));
|
||||
$empData = $this->employeePolicyModel->getEmployeePolicy(client_id: $this->request->getGet('client_id'), policy_id: $this->request->getGet('client_policy_id'), status: 0, branch_id: $this->request->getGet('client_branch_id'), staus_type: 'inactive');
|
||||
|
||||
if ($empData) {
|
||||
return $this->respond(['status' => 'success', 'code' => 200, 'data' => $empData], 200);
|
||||
|
||||
@ -222,7 +222,7 @@ class EmployeePolicyModel extends Model
|
||||
// return $res;
|
||||
// } // remarks do not remove
|
||||
|
||||
public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "")
|
||||
public function getEmployeePolicy($client_id = 0, $policy_id = 0, $status = [], $branch_id = 0, $emp_code = "", $emp_name = "", $staus_type = '')
|
||||
{
|
||||
// dd($status);
|
||||
$ecard_download_link = "
|
||||
@ -356,8 +356,13 @@ class EmployeePolicyModel extends Model
|
||||
// Always check these conditions
|
||||
$result
|
||||
->where('employee_polices.is_active', 1)
|
||||
->where('emp.is_active', 1)
|
||||
->where('employee_polices.status !=', 'inactive');
|
||||
->where('emp.is_active', 1);
|
||||
|
||||
if($staus_type == 'inactive'){
|
||||
$result->whereIn('employee_polices.status', ['active', 'inactive']);
|
||||
}else{
|
||||
$result->where('employee_polices.status !=', 'inactive');
|
||||
}
|
||||
|
||||
$res = $result->findAll();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user