skl/app/Models/Pelaporan/Lampiran.php

29 lines
661 B
PHP

<?php
namespace App\Models\Pelaporan;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Lampiran extends Model
{
protected $table = 'Lampiran';
public $timestamps = false;
protected $fillable = ['idmcpelaporan', 'idrefpelaporan'];
/**
* Cek no lampiran sertifikat
*/
public function cekNoLampiranSertifikat(array $filter)
{
return DB::table('mclampiran_sertifikat')
->join('mcpelaporan', 'mcpelaporan.id', '=', 'mclampiran_sertifikat.idmcpelaporan')
->where($filter)
->where('mclampiran_sertifikat.is_deleted', 0)
->first();
}
}