first commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Bukti extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.buktis';
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class CatatanPengajuan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'public.catatan_pengajuans';
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'user_id',
|
||||
'employee_id',
|
||||
'employee_name',
|
||||
'employee_role',
|
||||
'message',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Dokumen extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.dokumens';
|
||||
|
||||
function syarat()
|
||||
{
|
||||
return $this->belongsTo(Syarat::class, 'id_syarat', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Kegiatan extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.kegiatans';
|
||||
protected $guarded = [];
|
||||
|
||||
function syarats()
|
||||
{
|
||||
return $this->hasMany(Syarat::class, 'id_kegiatan', 'id');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function unit()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja');
|
||||
}
|
||||
|
||||
function unitPembayaran()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja_pimpinan');
|
||||
}
|
||||
|
||||
function getNamaSkAttribute($value): string | null
|
||||
{
|
||||
if (!$value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (str_starts_with($value, 'http')) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
$unit = UnitKerja::find($this->id_unit_kerja);
|
||||
$sk = "https://siska.untan.ac.id/storage/sk/$unit->nama/$value";
|
||||
|
||||
return $sk;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class LogPengajuan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'public.log_pengajuans';
|
||||
protected $fillable = [
|
||||
'logable_type',
|
||||
'logable_id',
|
||||
'user_id',
|
||||
'method',
|
||||
'employee_id',
|
||||
'employee_name',
|
||||
'employee_role',
|
||||
'message',
|
||||
'before',
|
||||
'after',
|
||||
];
|
||||
|
||||
function logable()
|
||||
{
|
||||
return $this->morphTo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Akreditasi;
|
||||
use App\Models\Verifikator\Prodi;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Membimbing extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.membimbings';
|
||||
protected $fillable = [
|
||||
'status_verifikasi_id',
|
||||
];
|
||||
|
||||
function statusVerifikasi()
|
||||
{
|
||||
return $this->belongsTo(StatusVerifikasi::class, 'status_verifikasi_id', 'id');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function notes()
|
||||
{
|
||||
return $this->morphMany(CatatanPengajuan::class, 'noteable');
|
||||
}
|
||||
|
||||
function unit()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja', 'id');
|
||||
}
|
||||
|
||||
function prodi()
|
||||
{
|
||||
return $this->belongsTo(Prodi::class, 'id_sub_unit_kerja', 'id');
|
||||
}
|
||||
|
||||
function pengali()
|
||||
{
|
||||
return $this->hasOneThrough(
|
||||
Akreditasi::class, // Model tujuan akhir (Akreditasi)
|
||||
Prodi::class, // Model perantara (Prodi)
|
||||
'id', // Foreign key di tabel Prodi (default: id_prodi dari Mengajar)
|
||||
'id', // Foreign key di tabel Akreditasi (default: id dari Prodi)
|
||||
'id_sub_unit_kerja', // Local key di tabel Mengajar
|
||||
'akreditasi_id' // Local key di tabel Prodi yang menghubungkan ke Akreditasi
|
||||
);
|
||||
}
|
||||
|
||||
function buktis()
|
||||
{
|
||||
return $this->morphMany(Bukti::class, 'buktiable');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Akreditasi;
|
||||
use App\Models\Verifikator\Prodi;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Mengajar extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.mengajars';
|
||||
protected $fillable = [
|
||||
'absen',
|
||||
'jumlah_pertemuan',
|
||||
'total_pertemuan',
|
||||
'status_verifikasi_id',
|
||||
];
|
||||
|
||||
function statusVerifikasi()
|
||||
{
|
||||
return $this->belongsTo(StatusVerifikasi::class, 'status_verifikasi_id', 'id');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function notes()
|
||||
{
|
||||
return $this->morphMany(CatatanPengajuan::class, 'noteable');
|
||||
}
|
||||
|
||||
function syarats()
|
||||
{
|
||||
return $this->hasOne(self::class, 'id', 'id');
|
||||
}
|
||||
|
||||
function unit()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja', 'id');
|
||||
}
|
||||
|
||||
function prodi()
|
||||
{
|
||||
return $this->belongsTo(Prodi::class, 'id_sub_unit_kerja', 'id');
|
||||
}
|
||||
|
||||
function pengali()
|
||||
{
|
||||
return $this->hasOneThrough(
|
||||
Akreditasi::class, // Model tujuan akhir (Akreditasi)
|
||||
Prodi::class, // Model perantara (Prodi)
|
||||
'id', // Foreign key di tabel Prodi (default: id_prodi dari Mengajar)
|
||||
'id', // Foreign key di tabel Akreditasi (default: id dari Prodi)
|
||||
'id_sub_unit_kerja', // Local key di tabel Mengajar
|
||||
'akreditasi_id' // Local key di tabel Prodi yang menghubungkan ke Akreditasi
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Akreditasi;
|
||||
use App\Models\Verifikator\Prodi;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Menguji extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.mengujis';
|
||||
protected $fillable = [
|
||||
'status_verifikasi_id',
|
||||
];
|
||||
|
||||
function statusVerifikasi()
|
||||
{
|
||||
return $this->belongsTo(StatusVerifikasi::class, 'status_verifikasi_id', 'id');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function notes()
|
||||
{
|
||||
return $this->morphMany(CatatanPengajuan::class, 'noteable');
|
||||
}
|
||||
|
||||
function unit()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'id_unit_kerja', 'id');
|
||||
}
|
||||
|
||||
function prodi()
|
||||
{
|
||||
return $this->belongsTo(Prodi::class, 'id_sub_unit_kerja', 'id');
|
||||
}
|
||||
|
||||
function pengali()
|
||||
{
|
||||
return $this->hasOneThrough(
|
||||
Akreditasi::class, // Model tujuan akhir (Akreditasi)
|
||||
Prodi::class, // Model perantara (Prodi)
|
||||
'id', // Foreign key di tabel Prodi (default: id_prodi dari Mengajar)
|
||||
'id', // Foreign key di tabel Akreditasi (default: id dari Prodi)
|
||||
'id_sub_unit_kerja', // Local key di tabel Mengajar
|
||||
'akreditasi_id' // Local key di tabel Prodi yang menghubungkan ke Akreditasi
|
||||
);
|
||||
}
|
||||
|
||||
function buktis()
|
||||
{
|
||||
return $this->morphMany(Bukti::class, 'buktiable');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PresensiTendik extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Tendik;
|
||||
use App\Models\Verifikator\UnitKerja;
|
||||
use App\Models\Verifikator\View\Pegawai;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Skp extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.skps';
|
||||
protected $fillable = [
|
||||
'id_periode',
|
||||
'id_pelaksana',
|
||||
'nama_pelaksana',
|
||||
'status_verifikasi_id',
|
||||
'nilai',
|
||||
'poin_total',
|
||||
'pembagi',
|
||||
'pengurang',
|
||||
'kriteria',
|
||||
'unit_pembayaran_id',
|
||||
];
|
||||
|
||||
function tendik()
|
||||
{
|
||||
return $this->belongsTo(Tendik::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function statusVerifikasi()
|
||||
{
|
||||
return $this->belongsTo(StatusVerifikasi::class);
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function notes()
|
||||
{
|
||||
return $this->morphMany(CatatanPengajuan::class, 'noteable');
|
||||
}
|
||||
|
||||
function pegawai()
|
||||
{
|
||||
return $this->belongsTo(Pegawai::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function unit()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'unit_pembayaran_id', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class StatusVerifikasi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'public.status_verifikasis';
|
||||
|
||||
function syarats()
|
||||
{
|
||||
return $this->hasMany(Syarat::class, 'status_verifikasi', 'id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SubUnitKerja extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'public.sub_unit_kerjas';
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Dosen;
|
||||
use App\Models\Verifikator\JabatanPegawaiDetail;
|
||||
use App\Models\Verifikator\Rubrik;
|
||||
use App\Models\Verifikator\Tendik;
|
||||
use App\Models\Verifikator\View\Pegawai;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Syarat extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'public.syarats';
|
||||
protected $guarded = [];
|
||||
|
||||
function kegiatan()
|
||||
{
|
||||
return $this->belongsTo(Kegiatan::class, 'id_kegiatan', 'id');
|
||||
}
|
||||
|
||||
function statusVerifikasi()
|
||||
{
|
||||
return $this->belongsTo(StatusVerifikasi::class, 'status_verifikasi_id', 'id');
|
||||
}
|
||||
|
||||
function dosen()
|
||||
{
|
||||
return $this->belongsTo(Dosen::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function tendik()
|
||||
{
|
||||
return $this->belongsTo(Tendik::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function dokumens()
|
||||
{
|
||||
return $this->hasMany(Dokumen::class, 'id_syarat', 'id');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function notes()
|
||||
{
|
||||
return $this->morphMany(CatatanPengajuan::class, 'noteable');
|
||||
}
|
||||
|
||||
function syarat()
|
||||
{
|
||||
return $this->belongsTo(Rubrik::class, 'id_rubrik');
|
||||
}
|
||||
|
||||
function jabatan()
|
||||
{
|
||||
return $this->belongsToMany(JabatanPegawaiDetail::class, 'verifikator.jabatan_pegawai_detail_syarats', 'syarat_id', 'jabatan_pegawai_detail_id')->withPivot('poin', 'biaya');
|
||||
}
|
||||
|
||||
function pegawai()
|
||||
{
|
||||
return $this->belongsTo(Pegawai::class, 'id_pelaksana', 'nip');
|
||||
}
|
||||
|
||||
function rubrik()
|
||||
{
|
||||
return $this->belongsTo(Rubrik::class, 'id_rubrik');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\DokSiremun;
|
||||
|
||||
use App\Models\Verifikator\Pagu;
|
||||
use App\Models\Verifikator\PenambahanPagu;
|
||||
use App\Models\Verifikator\Pobo;
|
||||
use App\Models\Verifikator\Rasio;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UnitKerja extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'public.unit_kerjas';
|
||||
|
||||
function rasios()
|
||||
{
|
||||
return $this->hasMany(Rasio::class);
|
||||
}
|
||||
|
||||
function pagus()
|
||||
{
|
||||
return $this->hasMany(Pagu::class, 'unit_pembayaran_id');
|
||||
}
|
||||
|
||||
function pagu()
|
||||
{
|
||||
return $this->hasOne(Pagu::class, 'unit_pembayaran_id');
|
||||
}
|
||||
|
||||
function pobo()
|
||||
{
|
||||
return $this->hasOne(Pobo::class, 'unit_kerja_id', 'id');
|
||||
}
|
||||
|
||||
function penambahanPagu()
|
||||
{
|
||||
return $this->hasMany(PenambahanPagu::class, 'unit_kerja_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user