Some cleaning up. About to release 3.2.1

This commit is contained in:
James Cole
2014-12-15 19:39:01 +01:00
parent 16678aa5e1
commit b999a8f0fb
10 changed files with 74 additions and 58 deletions

View File

@@ -223,28 +223,28 @@ class Account implements CUD, CommonDatabaseCalls, AccountInterface
// delete journals:
\TransactionJournal::whereIn(
'id', function ($query) use ($model) {
$query->select('transaction_journal_id')
->from('transactions')->whereIn(
'account_id', function ($query) use ($model) {
$query
->select('id')
->from('accounts')
->where(
$query->select('transaction_journal_id')
->from('transactions')->whereIn(
'account_id', function ($query) use ($model) {
$query
->select('id')
->from('accounts')
->where(
function ($q) use ($model) {
$q->where('id', $model->id);
$q->orWhere(
function ($q) use ($model) {
$q->where('id', $model->id);
$q->orWhere(
function ($q) use ($model) {
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
// TODO magic number!
$q->where('accounts.account_type_id', 3);
$q->where('accounts.active', 0);
}
);
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
// TODO magic number!
$q->where('accounts.account_type_id', 3);
$q->where('accounts.active', 0);
}
)->where('accounts.user_id', $this->getUser()->id);
}
)->get();
}
);
}
)->where('accounts.user_id', $this->getUser()->id);
}
)->get();
}
)->delete();
/*