mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Code cleanup [skip ci]
This commit is contained in:
@@ -3,6 +3,7 @@ use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model as Eloquent;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingTrait;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
/**
|
||||
* Class PiggyBank
|
||||
@@ -77,19 +78,19 @@ class PiggyBank extends Eloquent
|
||||
return $rep;
|
||||
} else {
|
||||
$query = $this->piggyBankRepetitions()->where(
|
||||
function ($q) {
|
||||
function (Builder $q) {
|
||||
|
||||
$q->where(
|
||||
function ($q) {
|
||||
function (Builder $q) {
|
||||
|
||||
$q->where(
|
||||
function ($q) {
|
||||
function (Builder $q) {
|
||||
$today = new Carbon;
|
||||
$q->whereNull('startdate');
|
||||
$q->orWhere('startdate', '<=', $today->format('Y-m-d 00:00:00'));
|
||||
}
|
||||
)->where(
|
||||
function ($q) {
|
||||
function (Builder $q) {
|
||||
$today = new Carbon;
|
||||
$q->whereNull('targetdate');
|
||||
$q->orWhere('targetdate', '>=', $today->format('Y-m-d 00:00:00'));
|
||||
@@ -97,7 +98,7 @@ class PiggyBank extends Eloquent
|
||||
);
|
||||
}
|
||||
)->orWhere(
|
||||
function ($q) {
|
||||
function (Builder $q) {
|
||||
$today = new Carbon;
|
||||
$q->where('startdate', '>=', $today->format('Y-m-d 00:00:00'));
|
||||
$q->where('targetdate', '>=', $today->format('Y-m-d 00:00:00'));
|
||||
|
||||
@@ -192,7 +192,7 @@ class TransactionJournal extends Eloquent
|
||||
public function scopeWithRelevantData(Builder $query)
|
||||
{
|
||||
$query->with(
|
||||
['transactions' => function ($q) {
|
||||
['transactions' => function (Builder $q) {
|
||||
$q->orderBy('amount', 'ASC');
|
||||
}, 'transactiontype', 'budgets','categories', 'transactions.account.accounttype', 'bill', 'budgets', 'categories']
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user