* Add saveAs for pivot preview filter.

This commit is contained in:
songchenxuan
2024-03-27 17:23:11 +08:00
committed by liyang
parent 2e053d7eb4
commit 5987166808
2 changed files with 2 additions and 21 deletions
+2 -2
View File
@@ -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()))));
-19
View File
@@ -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.
*