From 59871668088369dd7604a2707ab672f1ffe68503 Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Wed, 27 Mar 2024 16:21:51 +0800 Subject: [PATCH] * Add saveAs for pivot preview filter. --- module/pivot/ui/show.html.php | 4 ++-- module/pivot/zen.php | 19 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/module/pivot/ui/show.html.php b/module/pivot/ui/show.html.php index eb9e4c41dc..2b24ee24b9 100644 --- a/module/pivot/ui/show.html.php +++ b/module/pivot/ui/show.html.php @@ -25,7 +25,7 @@ foreach($pivot->filters as $filter) if($from == 'query') { $typeOption = $filter['typeOption']; - if($type == 'select' && !isset($options[$typeOption])) $options[$typeOption] = $this->getFilterOptions($typeOption); + if($type == 'select' && !isset($options[$typeOption])) $options[$typeOption] = $this->pivot->getSysOptions($typeOption); $filters[] = filter(set(array('title' => $name, 'type' => $type, 'name' => $field, 'value' => $value, 'items' => zget($options, $typeOption, array())))); } @@ -34,7 +34,7 @@ foreach($pivot->filters as $filter) if($type == 'select' && !isset($options[$field])) { $fieldSetting = $pivot->fieldSettings->$field; - $options[$field] = $this->getFilterOptions($fieldSetting->type, $fieldSetting->object, $fieldSetting->field, $pivot->sql); + $options[$field] = $this->pivot->getSysOptions($fieldSetting->type, $fieldSetting->object, $fieldSetting->field, $pivot->sql, zget($filter, 'saveAs', '')); } $filters[] = resultFilter(set(array('title' => $name, 'type' => $type, 'name' => $field, 'value' => $value, 'items' => zget($options, $field, array())))); diff --git a/module/pivot/zen.php b/module/pivot/zen.php index 3d64159eb8..5779849f9d 100644 --- a/module/pivot/zen.php +++ b/module/pivot/zen.php @@ -124,25 +124,6 @@ class pivotZen extends pivot return $menus; } - /** - * 获取透视表过滤器下拉选项。 - * Get filter options of pivot. - * - * @param string $type - * @param string $object - * @param string $field - * @param string $sql - * @access public - * @return array - */ - public function getFilterOptions(string $type, string $object = '', string $field = '', string $sql = ''): array - { - $result = array(); - $options = $this->pivot->getSysOptions($type, $object, $field, $sql); - foreach($options as $key => $value) $result[] = array('text' => $value, 'value' => $key); - return $result; - } - /** * Preview pivots of a group. *