Revert "* Refactor method of gen waterpolo."
This reverts commit 7166651759.
This commit is contained in:
+1
-11
@@ -592,16 +592,7 @@ class chartModel extends model
|
||||
return array($group, $metrics, $aggs, $xLabels, $yStats);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate waterpolo for screen designer.
|
||||
*
|
||||
* @param string $settings
|
||||
* @param string $defaultSql
|
||||
* @param array $filters
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function genWaterpolo($settings, $sql, $filters)
|
||||
public function genWaterpolo($fields, $settings, $sql, $filters)
|
||||
{
|
||||
$operate = "{$settings['calc']}({$settings['goal']})";
|
||||
$sql = "select $operate count from ($sql) tt ";
|
||||
@@ -638,7 +629,6 @@ class chartModel extends model
|
||||
|
||||
$series = array(array('type' => 'liquidFill', 'data' => array($percent), 'color' => array('#2e7fff'), 'outline' => array('show' => false), 'label' => array('fontSize' => 26)));
|
||||
$tooltip = array('show' => true);
|
||||
|
||||
$options = array('series' => $series, 'tooltip' => $tooltip);
|
||||
|
||||
return $options;
|
||||
|
||||
@@ -1553,7 +1553,7 @@ class screenModel extends model
|
||||
else
|
||||
{
|
||||
$setting = json_decode($chart->settings, true)[0];
|
||||
$options = $this->loadModel('chart')->genWaterPolo($setting, $chart->sql, $filters);
|
||||
$options = $this->loadModel('chart')->genWaterPolo(json_decode($chart->fieldSettings, true), $setting, $chart->sql, $filters);
|
||||
|
||||
$component->option->dataset = $options['series'][0]['data'][0];
|
||||
return $this->setComponentDefaults($component);
|
||||
|
||||
Reference in New Issue
Block a user