mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-11 07:10:48 +00:00
Optimize queries for statistics.
This commit is contained in:
@@ -23,9 +23,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\Form\FormSupport;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Collection;
|
||||
use Throwable;
|
||||
|
||||
@@ -43,7 +43,7 @@ class ExpandedForm
|
||||
*/
|
||||
public function amountNoCurrency(string $name, $value = null, ?array $options = null): string
|
||||
{
|
||||
$options ??= [];
|
||||
$options ??= [];
|
||||
$label = $this->label($name, $options);
|
||||
$options = $this->expandOptionArray($name, $label, $options);
|
||||
$classes = $this->getHolderClasses($name);
|
||||
@@ -74,8 +74,8 @@ class ExpandedForm
|
||||
*/
|
||||
public function checkbox(string $name, ?int $value = null, $checked = null, ?array $options = null): string
|
||||
{
|
||||
$options ??= [];
|
||||
$value ??= 1;
|
||||
$options ??= [];
|
||||
$value ??= 1;
|
||||
$options['checked'] = true === $checked;
|
||||
|
||||
if (app('session')->has('preFilled')) {
|
||||
@@ -83,10 +83,10 @@ class ExpandedForm
|
||||
$options['checked'] = $preFilled[$name] ?? $options['checked'];
|
||||
}
|
||||
|
||||
$label = $this->label($name, $options);
|
||||
$options = $this->expandOptionArray($name, $label, $options);
|
||||
$classes = $this->getHolderClasses($name);
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
$label = $this->label($name, $options);
|
||||
$options = $this->expandOptionArray($name, $label, $options);
|
||||
$classes = $this->getHolderClasses($name);
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
|
||||
unset($options['placeholder'], $options['autocomplete'], $options['class']);
|
||||
|
||||
@@ -157,10 +157,10 @@ class ExpandedForm
|
||||
public function integer(string $name, $value = null, ?array $options = null): string
|
||||
{
|
||||
$options ??= [];
|
||||
$label = $this->label($name, $options);
|
||||
$options = $this->expandOptionArray($name, $label, $options);
|
||||
$classes = $this->getHolderClasses($name);
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
$label = $this->label($name, $options);
|
||||
$options = $this->expandOptionArray($name, $label, $options);
|
||||
$classes = $this->getHolderClasses($name);
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
$options['step'] ??= '1';
|
||||
|
||||
try {
|
||||
@@ -209,9 +209,9 @@ class ExpandedForm
|
||||
/** @var Model $entry */
|
||||
foreach ($set as $entry) {
|
||||
// All Eloquent models have an ID
|
||||
$entryId = $entry->id;
|
||||
$current = $entry->toArray();
|
||||
$title = null;
|
||||
$entryId = $entry->id;
|
||||
$current = $entry->toArray();
|
||||
$title = null;
|
||||
foreach ($fields as $field) {
|
||||
if (array_key_exists($field, $current) && null === $title) {
|
||||
$title = $current[$field];
|
||||
|
Reference in New Issue
Block a user