Penambahan Menu Pagu Fakultas
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Models\Sidia\Pegawai as SidiaPegawai;
|
||||
use App\Models\Verifikator\Dosen;
|
||||
use App\Models\Verifikator\View\Pegawai;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -37,6 +38,26 @@ class JabatanPegawaiTambahanHelper
|
||||
*/
|
||||
const WAKIL_DEKAN_2_IDS = [7];
|
||||
|
||||
public static function getPimpinanFakultasInfo(?string $nip): ?object
|
||||
{
|
||||
if (! $nip) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$pegawai = SidiaPegawai::where(function ($query) use ($nip) {
|
||||
$query->where('nip', $nip)->orWhere('nip_siakad', $nip)->orWhere('nip_honorer', $nip);
|
||||
})
|
||||
->whereIn('jabatan_tugas_tambahan_id', array_merge(self::DEKAN_IDS, self::WAKIL_DEKAN_IDS))
|
||||
->whereBetween('unit_kerja_id', [1, 9])->first();
|
||||
|
||||
return $pegawai ? (object) [
|
||||
'nip' => $pegawai->nip,
|
||||
'unit_kerja_id' => $pegawai->unit_kerja_id,
|
||||
'unit_kerja_nama' => $pegawai->nama_unit_kerja,
|
||||
'jabatan_dtt_nama' => $pegawai->nama_jabatan_tugas_tambahan,
|
||||
] : null;
|
||||
}
|
||||
|
||||
public static function isDekan(string $nip): bool
|
||||
{
|
||||
if (Dosen::where('nip', $nip)->whereIn('jabatan_dtt_id', self::DEKAN_IDS)->exists()) {
|
||||
|
||||
Reference in New Issue
Block a user