first commit
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Verifikator;
|
||||
|
||||
use App\Models\DokSiremun\LogPengajuan;
|
||||
use App\Models\DokSiremun\Syarat;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class JabatanPegawaiDetail extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'verifikator.jabatan_pegawai_details';
|
||||
protected $with = ['fungsional', 'tambahan'];
|
||||
protected $fillable = ['jabatan_pegawai_id', 'jenis_pegawai', 'unit_kerja_id', 'bulan', 'golongan', 'status_pns', 'jabatan_fungsional_id', 'keterangan_jf', 'p1_jf', 'p2_jf', 'status_jf', 'p2_jabatan_fungsional', 'p2_jabatan_fungsional_fix', 'jabatan_tambahan_id', 'keterangan_jtt', 'p1_jtt', 'p2_jtt', 'status_jtt', 'p2_jabatan_tambahan', 'p2_jabatan_tambahan_fix', 'p2', 'pajak', 'netto', 'p1', 'p1_tax', 'p1_netto', 'paid_at', 'unit_pembayaran_id', 'keterangan'];
|
||||
|
||||
function jabatan()
|
||||
{
|
||||
return $this->belongsTo(JabatanPegawai::class, 'jabatan_pegawai_id', 'id');
|
||||
}
|
||||
|
||||
function fungsional()
|
||||
{
|
||||
return $this->belongsTo(JabatanFungsional::class, 'jabatan_fungsional_id', 'id');
|
||||
}
|
||||
|
||||
function tambahan()
|
||||
{
|
||||
return $this->belongsTo(JabatanTugasTambahan::class, 'jabatan_tambahan_id', 'id');
|
||||
}
|
||||
|
||||
function newQuery($excludeDeleted = true)
|
||||
{
|
||||
return parent::newQuery($excludeDeleted)->orderBy('bulan', 'asc');
|
||||
}
|
||||
|
||||
function logs()
|
||||
{
|
||||
return $this->morphMany(LogPengajuan::class, 'logable');
|
||||
}
|
||||
|
||||
function pangkat()
|
||||
{
|
||||
return $this->belongsTo(Pangkat::class, 'golongan', 'golongan');
|
||||
}
|
||||
|
||||
function syarat()
|
||||
{
|
||||
return $this->belongsToMany(Syarat::class, 'verifikator.jabatan_pegawai_detail_syarats', 'jabatan_pegawai_detail_id', 'syarat_id')->withPivot('poin', 'biaya');
|
||||
}
|
||||
|
||||
function remunerasi()
|
||||
{
|
||||
return $this->hasMany(RemunerasiPerBulan::class);
|
||||
}
|
||||
|
||||
function unit()
|
||||
{
|
||||
return $this->belongsTo(UnitKerja::class, 'unit_pembayaran_id');
|
||||
}
|
||||
|
||||
function unitKerja()
|
||||
{
|
||||
return $this->belongsTo(UnitKerjaPegawai::class, 'unit_kerja_id');
|
||||
}
|
||||
|
||||
function poin()
|
||||
{
|
||||
return $this->hasOne(JabatanPegawaiDetailPoin::class, 'jabatan_pegawai_detail_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user