From f277e8463b012ec76ee576d89b3f36b2c23bed42 Mon Sep 17 00:00:00 2001 From: zhouxin Date: Fri, 22 Dec 2023 10:45:12 +0800 Subject: [PATCH] Revert "* Refactor method of gen waterpolo." This reverts commit 71666517593d3ec2a15377f150371c0f5b6e0a59. --- module/chart/model.php | 12 +----------- module/screen/model.php | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/module/chart/model.php b/module/chart/model.php index 90f947897c..a7d7bdb5d9 100644 --- a/module/chart/model.php +++ b/module/chart/model.php @@ -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; diff --git a/module/screen/model.php b/module/screen/model.php index 8ff7a0ea17..9411b35b73 100644 --- a/module/screen/model.php +++ b/module/screen/model.php @@ -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);