|
|
@ -119,11 +119,11 @@ class HumanResourceController extends Controller |
|
|
|
if(empty($humanresource)) { |
|
|
|
if(empty($humanresource)) { |
|
|
|
return response()->json(['status' => 'failed', 'message' => 'Data Human Resource not found!', 'code' => 400], 400); |
|
|
|
return response()->json(['status' => 'failed', 'message' => 'Data Human Resource not found!', 'code' => 400], 400); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($request->company_id && isset($request->password) && isset($request->username)) { |
|
|
|
$transaction = ProductTransaction::query() |
|
|
|
$transaction = ProductTransaction::query() |
|
|
|
->where('company_id', $request->company_id); |
|
|
|
->where('company_id', $request->company_id); |
|
|
|
$cloneQueryTransaction = clone $transaction; |
|
|
|
$cloneQueryTransaction = clone $transaction; |
|
|
|
|
|
|
|
|
|
|
|
if($request->company_id && isset($request->password) && isset($request->username)) : |
|
|
|
|
|
|
|
$countCreate = false; |
|
|
|
$countCreate = false; |
|
|
|
$projectResult = HumanResource::query() |
|
|
|
$projectResult = HumanResource::query() |
|
|
|
->selectRaw('count(*) as total_hr') |
|
|
|
->selectRaw('count(*) as total_hr') |
|
|
@ -144,7 +144,9 @@ class HumanResourceController extends Controller |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$countCreate = true; |
|
|
|
$countCreate = true; |
|
|
|
} |
|
|
|
} |
|
|
|
endif; |
|
|
|
} else { |
|
|
|
|
|
|
|
$countCreate = true; |
|
|
|
|
|
|
|
} |
|
|
|
$request->ktp_number !== $humanresource['ktp_number'] ? $this->validate($request,['ktp_number'=>'unique:m_users,ktp_number|string']) : ''; |
|
|
|
$request->ktp_number !== $humanresource['ktp_number'] ? $this->validate($request,['ktp_number'=>'unique:m_users,ktp_number|string']) : ''; |
|
|
|
$request->email !== $humanresource['email'] ? $this->validate($request,['email'=>'unique:m_users,email|email']) : ''; |
|
|
|
$request->email !== $humanresource['email'] ? $this->validate($request,['email'=>'unique:m_users,email|email']) : ''; |
|
|
|
$request->password ? $this->validate($request,['password'=>'required|min:8']) : ''; |
|
|
|
$request->password ? $this->validate($request,['password'=>'required|min:8']) : ''; |
|
|
|