+ [refac] add isSummaryNotUse function.

This commit is contained in:
songchenxuan
2024-07-06 17:47:37 +08:00
committed by 周鑫
parent 34b3f95b42
commit 6b9026034c
+18 -2
View File
@@ -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)
{