From f6a824a43f14b8df6ae542ebefec076de0f06422 Mon Sep 17 00:00:00 2001 From: chentao Date: Wed, 14 Jun 2023 15:03:31 +0800 Subject: [PATCH] * Update the parameter name of the 'getFieldList' function in the datatableModel class to improve its clarity and understandability. --- module/datatable/control.php | 4 ++-- module/datatable/model.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/module/datatable/control.php b/module/datatable/control.php index ed0d1d16e8..64b730d114 100644 --- a/module/datatable/control.php +++ b/module/datatable/control.php @@ -139,9 +139,9 @@ class datatable extends control if(isset($this->config->datatable->$target->cols)) $setting = $this->config->datatable->$target->cols; if(empty($setting)) { - $cfgSurffix = ($module == 'program' && $method == 'productview') ? $method : ''; + $cfgMethod = ($module == 'program' && $method == 'productview') ? $method : ''; - $cols = $this->datatable->getFieldList($module, $cfgSurffix); + $cols = $this->datatable->getFieldList($module, $cfgMethod); $cols = $this->datatable->formatFields($module, $cols, false); } else diff --git a/module/datatable/model.php b/module/datatable/model.php index 53049579aa..20c52b0081 100644 --- a/module/datatable/model.php +++ b/module/datatable/model.php @@ -17,17 +17,17 @@ class datatableModel extends model * Get field list. * * @param string $module - * @param string $surffix + * @param string $method * @access public * @return array */ - public function getFieldList($module, $surffix = '') + public function getFieldList($module, $method = '') { /* Load corresponding module. */ if(!isset($this->config->$module)) $this->loadModel($module); $config = $this->config->$module; - if(!empty($surffix)) $config = $config->$surffix; + if(!empty($method)) $config = $config->$method; $fieldList = $config->dtable->fieldList; /* If doesn't need product, remove 'product' field. */