update db detail payment
This commit is contained in:
parent
9d61f551ba
commit
adcb956747
|
@ -10,6 +10,16 @@ class DetailPayment extends Model
|
|||
use HasFactory;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'detail_payments';
|
||||
|
||||
public static function cekTunggakan($santri_id)
|
||||
{
|
||||
return self::where('status', 'belum bayar')
|
||||
->whereHas('payment', function ($query) use ($santri_id) {
|
||||
$query->where('santri_id', $santri_id);
|
||||
})->orderBy('tahun_pembayaran', 'asc')
|
||||
->orderBy('bulan_pembayaran', 'asc')->first();
|
||||
}
|
||||
|
||||
public function payment()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue