GWM : getSelfBand~
This commit is contained in:
parent
ecd0fcf756
commit
6e64988e46
@ -275,6 +275,7 @@ class EmployeeRestController extends AdminController
|
|||||||
$item->gender = $this->GenderMap($item->relationship , $item->emp_code);
|
$item->gender = $this->GenderMap($item->relationship , $item->emp_code);
|
||||||
$item->dob = $this->convertDateFormatYMD($item->dob);
|
$item->dob = $this->convertDateFormatYMD($item->dob);
|
||||||
$item->emp_status = 'draft';
|
$item->emp_status = 'draft';
|
||||||
|
$item->band = $this->getSelfBand($item->emp_code,$item->client_id,$item->client_branch_id);
|
||||||
// dd($item);
|
// dd($item);
|
||||||
$employee = $this->employeeModel->insert($item);
|
$employee = $this->employeeModel->insert($item);
|
||||||
|
|
||||||
@ -312,6 +313,22 @@ class EmployeeRestController extends AdminController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSelfBand(string $emp_code, int $client_id, int $client_branch_id): ?string
|
||||||
|
{
|
||||||
|
$employee = $this->employeeModel
|
||||||
|
->where('emp_code', $emp_code)
|
||||||
|
->where('client_id', $client_id)
|
||||||
|
->where('client_branch_id', $client_branch_id)
|
||||||
|
->whereIn('emp_status', ['draft', 'enrolled'])
|
||||||
|
->where('is_active', 1)
|
||||||
|
->where('relationship','Self')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
return $employee['band'] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getEmployeePayableValue($client_policy_id,$relationship)
|
public function getEmployeePayableValue($client_policy_id,$relationship)
|
||||||
{
|
{
|
||||||
$terms = $this->clientPolicyModel->where('id',$client_policy_id)->get()->getRow()->policy_terms;
|
$terms = $this->clientPolicyModel->where('id',$client_policy_id)->get()->getRow()->policy_terms;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user