Merge pull request #6 from alealien666/manualPay
update db detail payment
This commit is contained in:
commit
1bbc867173
|
@ -10,6 +10,16 @@ class DetailPayment extends Model
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $guarded = ['id'];
|
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()
|
public function payment()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue