From c35e24d08bcbdeb2dfa3f4ae29b71706ca3cce57 Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Mon, 13 May 2024 12:59:39 +0200 Subject: [PATCH] Fix viste --- src/Util/Query.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Util/Query.php b/src/Util/Query.php index 77b1bfffd..1d330620c 100755 --- a/src/Util/Query.php +++ b/src/Util/Query.php @@ -439,11 +439,11 @@ class Query $select = []; foreach ($views as $view) { - $select[] = $view['query'].(!empty($view['name']) ? " AS '".$view['name']."'" : ''); + $select[] = $view['query'].(!empty($view['title']) ? " AS '".$view['title']."'" : ''); if (!empty($view['visible'])) { - if (!empty($view['name'])) { - $view['name'] = trim($view['name']); + if (!empty($view['title'])) { + $view['title'] = trim($view['title']); } if (!empty($view['search_inside'])) { $view['search_inside'] = trim($view['search_inside']); @@ -452,21 +452,21 @@ class Query $view['order_by'] = trim($view['order_by']); } - $fields[] = trim($view['name']); + $fields[] = $view['title'] ? trim($view['title']) : $view['name']; - $search_inside[] = !empty($view['search_inside']) ? $view['search_inside'] : '`'.$view['name'].'`'; - $order_by[] = !empty($view['order_by']) ? $view['order_by'] : '`'.$view['name'].'`'; + $search_inside[] = !empty($view['search_inside']) ? $view['search_inside'] : '`'.$view['title'].'`'; + $order_by[] = !empty($view['order_by']) ? $view['order_by'] : '`'.$view['title'].'`'; $search[] = $view['search']; $slow[] = $view['slow']; $format[] = $view['format']; $html_format[] = $view['html_format']; if ($view['summable']) { - $summable[] = 'SUM(`'.trim($view['name']."`) AS 'sum_".(count($fields) - 1)."'"); + $summable[] = 'SUM(`'.trim($view['title']."`) AS 'sum_".(count($fields) - 1)."'"); } if ($view['avg']) { - $avg[] = 'AVG(`'.trim($view['name']."`) AS 'avg_".(count($fields) - 1)."'"); + $avg[] = 'AVG(`'.trim($view['title']."`) AS 'avg_".(count($fields) - 1)."'"); } } }