* Add saveAs for pivot preview filter.
This commit is contained in:
@@ -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()))));
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user