mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-23 09:26:29 -06:00
Closed #40 [skip ci]
This commit is contained in:
parent
4bd79c880c
commit
2fbf837354
@ -164,14 +164,16 @@ class Account implements CUDInterface, CommonDatabaseCallsInterface, AccountInte
|
|||||||
->whereIn(
|
->whereIn(
|
||||||
'account_id', function (QueryBuilder $query) use ($model) {
|
'account_id', function (QueryBuilder $query) use ($model) {
|
||||||
$query
|
$query
|
||||||
->select('id')->from('accounts')
|
->select('accounts.id')
|
||||||
|
->from('accounts')
|
||||||
|
->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||||
->where(
|
->where(
|
||||||
function (QueryBuilder $q) use ($model) {
|
function (QueryBuilder $q) use ($model) {
|
||||||
$q->where('id', $model->id);
|
$q->where('id', $model->id);
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
function (QueryBuilder $q) use ($model) {
|
function (QueryBuilder $q) use ($model) {
|
||||||
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
||||||
$q->where('accounts.account_type_id', 3);
|
$q->where('account_types.type', 'Initial balance account');
|
||||||
$q->where('accounts.active', 0);
|
$q->where('accounts.active', 0);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -194,13 +196,15 @@ class Account implements CUDInterface, CommonDatabaseCallsInterface, AccountInte
|
|||||||
\Transaction::whereIn('id', $transactions)->delete();
|
\Transaction::whereIn('id', $transactions)->delete();
|
||||||
}
|
}
|
||||||
\Event::fire('account.destroy', [$model]);
|
\Event::fire('account.destroy', [$model]);
|
||||||
\Account::where(
|
\Account::
|
||||||
|
leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
||||||
|
->where(
|
||||||
function (EloquentBuilder $q) use ($model) {
|
function (EloquentBuilder $q) use ($model) {
|
||||||
$q->where('id', $model->id);
|
$q->where('id', $model->id);
|
||||||
$q->orWhere(
|
$q->orWhere(
|
||||||
function (EloquentBuilder $q) use ($model) {
|
function (EloquentBuilder $q) use ($model) {
|
||||||
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
||||||
$q->where('accounts.account_type_id', 3);
|
$q->where('account_types.type', 'Initial balance account');
|
||||||
$q->where('accounts.active', 0);
|
$q->where('accounts.active', 0);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user