Browse Source

update HRController

pull/1/head
wahyuun 10 months ago
parent
commit
233a7720ad
  1. 12
      app/Http/Controllers/HumanResourceController.php

12
app/Http/Controllers/HumanResourceController.php

@ -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);
} }
$transaction = ProductTransaction::query()
->where('company_id', $request->company_id);
$cloneQueryTransaction = clone $transaction;
if($request->company_id && isset($request->password) && isset($request->username)) : if($request->company_id && isset($request->password) && isset($request->username)) {
$transaction = ProductTransaction::query()
->where('company_id', $request->company_id);
$cloneQueryTransaction = clone $transaction;
$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']) : '';

Loading…
Cancel
Save