mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
More cleanup for budgets.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?php namespace FireflyIII\Models;
|
||||
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
@@ -59,6 +61,28 @@ class LimitRepetition extends Model
|
||||
return $this->belongsTo('FireflyIII\Models\BudgetLimit');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param Carbon $date
|
||||
*
|
||||
*/
|
||||
public function scopeAfter(Builder $query, Carbon $date)
|
||||
{
|
||||
$query->where('limit_repetitions.startdate', '>=', $date->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param Builder $query
|
||||
* @param Carbon $date
|
||||
*
|
||||
*/
|
||||
public function scopeBefore(Builder $query, Carbon $date)
|
||||
{
|
||||
$query->where('limit_repetitions.enddate', '<=', $date->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
*/
|
||||
|
Reference in New Issue
Block a user