From 6b9026034c8a90dd0f2287477fb03c3a4e90659a Mon Sep 17 00:00:00 2001 From: songchenxuan Date: Sat, 6 Jul 2024 15:54:17 +0800 Subject: [PATCH] + [refac] add isSummaryNotUse function. --- lib/pivotstate/pivotstate.class.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/pivotstate/pivotstate.class.php b/lib/pivotstate/pivotstate.class.php index 508be55538..0a50231815 100644 --- a/lib/pivotstate/pivotstate.class.php +++ b/lib/pivotstate/pivotstate.class.php @@ -259,12 +259,12 @@ class pivotState public $addQueryFilter = array(); /** - * step2 finish with Sql + * step2 finish with Sql, used to judge if step1 sql changed * * @var string * @access public */ - public $step2FinishSql = '' + public $step2FinishSql = ''; /** * __construct method. @@ -304,6 +304,7 @@ class pivotState $this->fieldSettings = array_merge_recursive($this->fields, $this->langs); $this->setPager(); $this->formatSettingColumns(); + $this->setStep2FinishSql(); } /** @@ -501,6 +502,17 @@ class pivotState return $filterWheres; } + /** + * Complete settings. + * + * @access public + * @return void + */ + public function isSummaryNotUse() + { + return (isset($this->settings['summary']) && $this->settings['summary'] == 'notuse'); + } + /** * Complete settings. * @@ -509,6 +521,8 @@ class pivotState */ public function completeSettings() { + if($this->isSummaryNotUse()) return; + $settings = $this->settings; if(!isset($settings['summary']) || $settings['summary'] !== 'notuse') $this->settings['summary'] = 'use'; if(!isset($settings['group1'])) $this->settings['group1'] = ''; @@ -918,6 +932,8 @@ class pivotState */ public function checkSettings() { + if($this->isSummaryNotUse()) array(); + $errors = array(); foreach($this->settings as $key => $value) {