2015-02-23 20:25:48 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FireflyIII\Helpers\Report;
|
|
|
|
|
|
|
|
use Auth;
|
|
|
|
use Carbon\Carbon;
|
2015-03-31 22:46:11 +02:00
|
|
|
use Crypt;
|
2015-02-23 21:19:16 +01:00
|
|
|
use FireflyIII\Models\Account;
|
2015-05-16 15:43:58 +02:00
|
|
|
use FireflyIII\Models\Budget;
|
2015-02-23 20:25:48 +01:00
|
|
|
use FireflyIII\Models\TransactionJournal;
|
2015-12-09 22:39:50 -02:00
|
|
|
use FireflyIII\Models\TransactionType;
|
2015-02-23 20:25:48 +01:00
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
use Illuminate\Database\Query\JoinClause;
|
|
|
|
use Illuminate\Support\Collection;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ReportQuery
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Helpers\Report
|
|
|
|
*/
|
|
|
|
class ReportQuery implements ReportQueryInterface
|
|
|
|
{
|
2015-05-20 06:48:52 +02:00
|
|
|
/**
|
2015-07-09 09:41:54 +02:00
|
|
|
* See ReportQueryInterface::incomeInPeriodCorrected.
|
|
|
|
*
|
|
|
|
* This method's length is caused mainly by the query build stuff. Therefor:
|
|
|
|
*
|
|
|
|
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
|
2015-05-20 06:48:52 +02:00
|
|
|
*
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
* @param bool $includeShared
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function expenseInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false)
|
|
|
|
{
|
|
|
|
$query = $this->queryJournalsWithTransactions($start, $end);
|
|
|
|
if ($includeShared === false) {
|
|
|
|
$query->where(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (Builder $query) {
|
2015-05-20 06:48:52 +02:00
|
|
|
$query->where(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (Builder $q) { // only get withdrawals not from a shared account
|
2015-12-09 22:39:50 -02:00
|
|
|
$q->where('transaction_types.type', TransactionType::WITHDRAWAL);
|
2015-05-20 06:48:52 +02:00
|
|
|
$q->where('acm_from.data', '!=', '"sharedAsset"');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$query->orWhere(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (Builder $q) { // and transfers from a shared account.
|
2015-12-09 22:39:50 -02:00
|
|
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
2015-05-20 06:48:52 +02:00
|
|
|
$q->where('acm_to.data', '=', '"sharedAsset"');
|
2015-08-29 06:48:12 +02:00
|
|
|
$q->where('acm_from.data', '!=', '"sharedAsset"');
|
2015-05-20 06:48:52 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} else {
|
2015-12-09 22:39:50 -02:00
|
|
|
$query->where('transaction_types.type', TransactionType::WITHDRAWAL); // any withdrawal is fine.
|
2015-05-20 06:48:52 +02:00
|
|
|
}
|
|
|
|
$query->orderBy('transaction_journals.date');
|
2015-07-07 10:05:11 +02:00
|
|
|
$data = $query->get( // get everything
|
2015-05-20 19:55:53 +02:00
|
|
|
['transaction_journals.*', 'transaction_types.type', 'ac_to.name as name', 'ac_to.id as account_id', 'ac_to.encrypted as account_encrypted']
|
|
|
|
);
|
2015-05-20 07:20:02 +02:00
|
|
|
|
|
|
|
$data->each(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (TransactionJournal $journal) {
|
2015-05-20 07:20:02 +02:00
|
|
|
if (intval($journal->account_encrypted) == 1) {
|
|
|
|
$journal->name = Crypt::decrypt($journal->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2015-05-20 06:48:52 +02:00
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
|
2015-02-23 21:19:16 +01:00
|
|
|
/**
|
|
|
|
* Get a users accounts combined with various meta-data related to the start and end date.
|
|
|
|
*
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
2015-05-15 20:07:51 +02:00
|
|
|
* @param bool $includeShared
|
2015-02-23 21:19:16 +01:00
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
2015-05-15 20:07:51 +02:00
|
|
|
public function getAllAccounts(Carbon $start, Carbon $end, $includeShared = false)
|
2015-02-23 21:19:16 +01:00
|
|
|
{
|
2015-03-10 19:51:24 +01:00
|
|
|
$query = Auth::user()->accounts()->orderBy('accounts.name', 'ASC')
|
2015-06-06 23:09:12 +02:00
|
|
|
->accountTypeIn(['Default account', 'Asset account', 'Cash account']);
|
2015-05-15 20:07:51 +02:00
|
|
|
if ($includeShared === false) {
|
2015-03-10 19:51:24 +01:00
|
|
|
$query->leftJoin(
|
2015-06-03 21:25:11 +02:00
|
|
|
'account_meta', function (JoinClause $join) {
|
2015-03-10 19:51:24 +01:00
|
|
|
$join->on('account_meta.account_id', '=', 'accounts.id')->where('account_meta.name', '=', 'accountRole');
|
|
|
|
}
|
|
|
|
)
|
2015-06-06 23:09:12 +02:00
|
|
|
->where(
|
|
|
|
function (Builder $query) {
|
2015-03-10 19:51:24 +01:00
|
|
|
|
2015-06-06 23:09:12 +02:00
|
|
|
$query->where('account_meta.data', '!=', '"sharedAsset"');
|
|
|
|
$query->orWhereNull('account_meta.data');
|
2015-03-10 19:51:24 +01:00
|
|
|
|
2015-06-06 23:09:12 +02:00
|
|
|
}
|
|
|
|
);
|
2015-03-10 19:51:24 +01:00
|
|
|
}
|
|
|
|
$set = $query->get(['accounts.*']);
|
2015-12-11 09:39:17 +01:00
|
|
|
|
2015-02-23 21:19:16 +01:00
|
|
|
return $set;
|
|
|
|
}
|
|
|
|
|
2015-02-23 20:25:48 +01:00
|
|
|
|
2015-05-20 06:48:52 +02:00
|
|
|
/**
|
|
|
|
* This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results
|
|
|
|
* will simply list the transaction journals only. This should allow any follow up counting to be accurate with
|
|
|
|
* regards to tags.
|
2015-05-22 15:05:32 +02:00
|
|
|
*
|
|
|
|
* This method returns all "income" journals in a certain period, which are both transfers from a shared account
|
|
|
|
* and "ordinary" deposits. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
|
|
|
|
* not group and returns different fields.
|
2015-05-20 06:48:52 +02:00
|
|
|
*
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
* @param bool $includeShared
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function incomeInPeriodCorrected(Carbon $start, Carbon $end, $includeShared = false)
|
|
|
|
{
|
|
|
|
$query = $this->queryJournalsWithTransactions($start, $end);
|
|
|
|
if ($includeShared === false) {
|
|
|
|
// only get deposits not to a shared account
|
|
|
|
// and transfers to a shared account.
|
|
|
|
$query->where(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (Builder $query) {
|
2015-05-20 06:48:52 +02:00
|
|
|
$query->where(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (Builder $q) {
|
2015-12-09 22:39:50 -02:00
|
|
|
$q->where('transaction_types.type', TransactionType::DEPOSIT);
|
2015-05-20 06:48:52 +02:00
|
|
|
$q->where('acm_to.data', '!=', '"sharedAsset"');
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$query->orWhere(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (Builder $q) {
|
2015-12-09 22:39:50 -02:00
|
|
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
2015-05-20 06:48:52 +02:00
|
|
|
$q->where('acm_from.data', '=', '"sharedAsset"');
|
2015-12-11 09:39:17 +01:00
|
|
|
$q->where('acm_to.data', '!=', '"sharedAsset"');
|
2015-05-20 06:48:52 +02:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
// any deposit is fine.
|
2015-12-09 22:39:50 -02:00
|
|
|
$query->where('transaction_types.type', TransactionType::DEPOSIT);
|
2015-05-20 06:48:52 +02:00
|
|
|
}
|
|
|
|
$query->orderBy('transaction_journals.date');
|
|
|
|
|
|
|
|
// get everything
|
2015-05-20 19:55:53 +02:00
|
|
|
$data = $query->get(
|
|
|
|
['transaction_journals.*', 'transaction_types.type', 'ac_from.name as name', 'ac_from.id as account_id', 'ac_from.encrypted as account_encrypted']
|
|
|
|
);
|
2015-05-20 07:20:02 +02:00
|
|
|
|
|
|
|
$data->each(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (TransactionJournal $journal) {
|
2015-05-20 07:20:02 +02:00
|
|
|
if (intval($journal->account_encrypted) == 1) {
|
|
|
|
$journal->name = Crypt::decrypt($journal->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$data = $data->filter(
|
2015-06-06 23:09:12 +02:00
|
|
|
function (TransactionJournal $journal) {
|
2015-05-20 07:20:02 +02:00
|
|
|
if ($journal->amount != 0) {
|
|
|
|
return $journal;
|
|
|
|
}
|
2015-06-03 21:25:11 +02:00
|
|
|
|
2015-05-26 08:17:58 +02:00
|
|
|
return null;
|
|
|
|
}
|
2015-05-20 07:20:02 +02:00
|
|
|
);
|
2015-03-10 19:51:24 +01:00
|
|
|
|
2015-05-20 06:48:52 +02:00
|
|
|
return $data;
|
|
|
|
}
|
2015-02-23 20:25:48 +01:00
|
|
|
|
2015-05-20 07:07:46 +02:00
|
|
|
/**
|
|
|
|
* Covers tags
|
|
|
|
*
|
|
|
|
* @param Account $account
|
|
|
|
* @param Budget $budget
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
*
|
|
|
|
* @return float
|
|
|
|
*/
|
|
|
|
public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end)
|
|
|
|
{
|
|
|
|
|
2015-12-11 18:49:07 +01:00
|
|
|
return Auth::user()->transactionjournals()
|
2015-07-26 19:07:02 +02:00
|
|
|
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
|
|
|
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
2015-12-09 22:39:50 -02:00
|
|
|
->transactionTypes([TransactionType::WITHDRAWAL])
|
2015-07-26 19:07:02 +02:00
|
|
|
->where('transactions.account_id', $account->id)
|
|
|
|
->before($end)
|
|
|
|
->after($start)
|
|
|
|
->where('budget_transaction_journal.budget_id', $budget->id)
|
2015-12-11 18:49:07 +01:00
|
|
|
->get(['transaction_journals.*'])->sum('amount');
|
2015-05-20 07:07:46 +02:00
|
|
|
}
|
|
|
|
|
2015-05-16 16:47:52 +02:00
|
|
|
/**
|
|
|
|
* @param Account $account
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
*
|
2015-06-13 10:02:36 +02:00
|
|
|
* @return string
|
2015-05-16 16:47:52 +02:00
|
|
|
*/
|
2015-07-06 22:12:35 +02:00
|
|
|
public function spentNoBudget(Account $account, Carbon $start, Carbon $end)
|
2015-05-16 16:47:52 +02:00
|
|
|
{
|
2015-06-13 10:02:36 +02:00
|
|
|
return
|
2015-05-16 16:47:52 +02:00
|
|
|
Auth::user()->transactionjournals()
|
|
|
|
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
|
|
|
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
2015-12-09 22:39:50 -02:00
|
|
|
->transactionTypes([TransactionType::WITHDRAWAL])
|
2015-05-16 16:47:52 +02:00
|
|
|
->where('transactions.account_id', $account->id)
|
|
|
|
->before($end)
|
|
|
|
->after($start)
|
2015-06-13 10:02:36 +02:00
|
|
|
->whereNull('budget_transaction_journal.budget_id')->get(['transaction_journals.*'])->sum('amount');
|
2015-03-29 11:51:26 +02:00
|
|
|
}
|
|
|
|
|
2015-03-29 12:12:06 +02:00
|
|
|
/**
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
*
|
|
|
|
* @return Builder
|
|
|
|
*/
|
|
|
|
protected function queryJournalsWithTransactions(Carbon $start, Carbon $end)
|
|
|
|
{
|
|
|
|
$query = TransactionJournal::
|
|
|
|
leftJoin(
|
2015-06-03 21:25:11 +02:00
|
|
|
'transactions as t_from', function (JoinClause $join) {
|
2015-03-29 12:12:06 +02:00
|
|
|
$join->on('t_from.transaction_journal_id', '=', 'transaction_journals.id')->where('t_from.amount', '<', 0);
|
|
|
|
}
|
|
|
|
)
|
2015-06-06 23:09:12 +02:00
|
|
|
->leftJoin('accounts as ac_from', 't_from.account_id', '=', 'ac_from.id')
|
|
|
|
->leftJoin(
|
|
|
|
'account_meta as acm_from', function (JoinClause $join) {
|
|
|
|
$join->on('ac_from.id', '=', 'acm_from.account_id')->where('acm_from.name', '=', 'accountRole');
|
|
|
|
}
|
|
|
|
)
|
|
|
|
->leftJoin(
|
|
|
|
'transactions as t_to', function (JoinClause $join) {
|
|
|
|
$join->on('t_to.transaction_journal_id', '=', 'transaction_journals.id')->where('t_to.amount', '>', 0);
|
|
|
|
}
|
|
|
|
)
|
|
|
|
->leftJoin('accounts as ac_to', 't_to.account_id', '=', 'ac_to.id')
|
|
|
|
->leftJoin(
|
|
|
|
'account_meta as acm_to', function (JoinClause $join) {
|
|
|
|
$join->on('ac_to.id', '=', 'acm_to.account_id')->where('acm_to.name', '=', 'accountRole');
|
|
|
|
}
|
|
|
|
)
|
|
|
|
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id');
|
2015-03-29 12:12:06 +02:00
|
|
|
$query->before($end)->after($start)->where('transaction_journals.user_id', Auth::user()->id);
|
|
|
|
|
|
|
|
return $query;
|
|
|
|
}
|
2015-12-11 09:39:17 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method works the same way as ReportQueryInterface::incomeInPeriod does, but instead of returning results
|
|
|
|
* will simply list the transaction journals only. This should allow any follow up counting to be accurate with
|
|
|
|
* regards to tags. It will only get the incomes to the specified accounts.
|
|
|
|
*
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
* @param Collection $accounts
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function incomeInPeriodCorrectedForList(Carbon $start, Carbon $end, Collection $accounts)
|
|
|
|
{
|
|
|
|
$query = $this->queryJournalsWithTransactions($start, $end);
|
|
|
|
|
|
|
|
$ids = [];
|
|
|
|
/** @var Account $account */
|
|
|
|
foreach ($accounts as $account) {
|
|
|
|
$ids[] = $account->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OR is a deposit
|
|
|
|
// OR is a transfer FROM a shared account to NOT a shared account.
|
|
|
|
//
|
2015-12-12 12:36:36 +01:00
|
|
|
// New idea: from the perspective of a shared account,
|
|
|
|
// a transfer from a not-shared account is income!
|
|
|
|
// so:
|
|
|
|
// OR is a transfer from NOT a shared account to a shared account.
|
|
|
|
|
|
|
|
|
2015-12-11 09:39:17 +01:00
|
|
|
|
|
|
|
$query->where(
|
|
|
|
function (Builder $query) {
|
|
|
|
$query->where(
|
|
|
|
function (Builder $q) {
|
|
|
|
$q->where('transaction_types.type', TransactionType::DEPOSIT);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$query->orWhere(
|
|
|
|
function (Builder $q) {
|
|
|
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
2015-12-11 16:36:40 +01:00
|
|
|
$q->where('acm_from.data', '=', '"sharedAsset"');
|
2015-12-11 09:39:17 +01:00
|
|
|
$q->where('acm_to.data', '!=', '"sharedAsset"');
|
|
|
|
}
|
|
|
|
);
|
2015-12-12 12:36:36 +01:00
|
|
|
$query->orWhere(
|
|
|
|
function (Builder $q) {
|
|
|
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
|
|
|
$q->where('acm_from.data', '!=', '"sharedAsset"');
|
|
|
|
$q->where('acm_to.data', '=', '"sharedAsset"');
|
|
|
|
}
|
|
|
|
);
|
2015-12-11 09:39:17 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// only include selected accounts.
|
2015-12-11 11:32:22 +01:00
|
|
|
$query->whereIn('ac_to.id', $ids);
|
2015-12-11 09:39:17 +01:00
|
|
|
$query->orderBy('transaction_journals.date');
|
|
|
|
|
|
|
|
// get everything
|
|
|
|
$data = $query->get(
|
|
|
|
['transaction_journals.*', 'transaction_types.type', 'ac_from.name as name', 'ac_from.id as account_id', 'ac_from.encrypted as account_encrypted']
|
|
|
|
);
|
|
|
|
|
|
|
|
$data->each(
|
|
|
|
function (TransactionJournal $journal) {
|
|
|
|
if (intval($journal->account_encrypted) == 1) {
|
|
|
|
$journal->name = Crypt::decrypt($journal->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$data = $data->filter(
|
|
|
|
function (TransactionJournal $journal) {
|
|
|
|
if ($journal->amount != 0) {
|
|
|
|
return $journal;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2015-12-11 16:36:40 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* See ReportQueryInterface::incomeInPeriodCorrected
|
|
|
|
*
|
|
|
|
* This method returns all "expense" journals in a certain period, which are both transfers to a shared account
|
|
|
|
* and "ordinary" withdrawals. The query used is almost equal to ReportQueryInterface::journalsByRevenueAccount but it does
|
|
|
|
* not group and returns different fields.
|
|
|
|
*
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
* @param Collection $accounts
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public function expenseInPeriodCorrectedForList(Carbon $start, Carbon $end, Collection $accounts)
|
|
|
|
{
|
|
|
|
$ids = [];
|
|
|
|
|
|
|
|
/** @var Account $account */
|
|
|
|
foreach ($accounts as $account) {
|
|
|
|
$ids[] = $account->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
$query = $this->queryJournalsWithTransactions($start, $end);
|
2015-12-11 16:39:33 +01:00
|
|
|
|
|
|
|
|
2015-12-11 16:36:40 +01:00
|
|
|
$query->where(
|
|
|
|
function (Builder $query) {
|
|
|
|
$query->where(
|
2015-12-11 16:39:33 +01:00
|
|
|
function (Builder $q) { // only get withdrawals from any account:
|
2015-12-11 16:36:40 +01:00
|
|
|
$q->where('transaction_types.type', TransactionType::WITHDRAWAL);
|
2015-12-11 16:39:33 +01:00
|
|
|
//$q->where('acm_from.data', '!=', '"sharedAsset"');
|
2015-12-11 16:36:40 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
$query->orWhere(
|
2015-12-11 16:39:33 +01:00
|
|
|
function (Builder $q) { // and transfers from a shared account to a not-shared account.
|
2015-12-11 16:36:40 +01:00
|
|
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
|
|
|
$q->where('acm_to.data', '=', '"sharedAsset"');
|
|
|
|
$q->where('acm_from.data', '!=', '"sharedAsset"');
|
|
|
|
}
|
|
|
|
);
|
2015-12-12 20:07:33 +01:00
|
|
|
// OR transfers from a NOT shared account to a shared account.
|
|
|
|
$query->orWhere(
|
|
|
|
function (Builder $q) { // and transfers from a shared account to a not-shared account.
|
|
|
|
$q->where('transaction_types.type', TransactionType::TRANSFER);
|
|
|
|
$q->where('acm_to.data', '!=', '"sharedAsset"');
|
|
|
|
$q->where('acm_from.data', '=', '"sharedAsset"');
|
|
|
|
}
|
|
|
|
);
|
2015-12-11 16:36:40 +01:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
// expense goes from the selected accounts:
|
|
|
|
$query->whereIn('ac_from.id', $ids);
|
|
|
|
|
|
|
|
$query->orderBy('transaction_journals.date');
|
|
|
|
$data = $query->get( // get everything
|
|
|
|
['transaction_journals.*', 'transaction_types.type', 'ac_to.name as name', 'ac_to.id as account_id', 'ac_to.encrypted as account_encrypted']
|
|
|
|
);
|
|
|
|
|
|
|
|
$data->each(
|
|
|
|
function (TransactionJournal $journal) {
|
|
|
|
if (intval($journal->account_encrypted) == 1) {
|
|
|
|
$journal->name = Crypt::decrypt($journal->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2015-03-29 08:14:32 +02:00
|
|
|
}
|