Merge branch 'sprint/konglinmao_optimize_code2' into 'master'

* Optimize code.

See merge request easycorp/zentaopms!6640
This commit is contained in:
王怡栋
2022-12-27 08:48:41 +00:00
2 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -130,9 +130,9 @@ $config->framework->sendXDO = true; // Send X-Download-Options header.
$config->framework->detectDevice['zh-cn'] = true; // 在zh-cn语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['zh-tw'] = true; // 在zh-tw语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['en'] = true; // 在en语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['de'] = true; // 在en语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['fr'] = true; // 在en语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['vi'] = true; // 在en语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['de'] = true; // 在de语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['fr'] = true; // 在fr语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
$config->framework->detectDevice['vi'] = true; // 在vi语言情况下,是否启用设备检测功能。 Whether enable device detect or not.
/* IP white list settings.*/
$config->ipWhiteList = '*';
+6 -5
View File
@@ -497,6 +497,7 @@ class baseDAO
* Set the data to update or insert.
*
* @param object $data the data object or array
* @param string $skipFields the skip fields
* @access public
* @return static|sql the dao object self.
*/
@@ -541,7 +542,7 @@ class baseDAO
}
/**
* 查看SQL索引
* 解析SQL语句
* Explain sql.
*
* @param string $sql
@@ -577,7 +578,7 @@ class baseDAO
$sql = sprintf($this->sqlobj->get(), $this->fields, $this->table);
}
/* If the method if select, update or delete, set the lang condition. */
/* If the method is select, update or delete, set the lang condition. */
if($this->autoLang and $this->table != '' and $this->method != 'insert' and $this->method != 'replace')
{
$lang = $this->app->getClientLang();
@@ -589,17 +590,17 @@ class baseDAO
$orderPOS = strrpos($sql, DAO::ORDERBY); // The position of ORDERBY keyword.
$limitPOS = strrpos($sql, DAO::LIMIT); // The position of LIMIT keyword.
$splitPOS = $orderPOS ? $orderPOS : $limitPOS; // If $orderPOS, use it instead of $limitPOS.
$splitPOS = $havingPOS? $havingPOS: $splitPOS; // If $havingPOS, use it instead of $orderPOS.
$splitPOS = $havingPOS ? $havingPOS : $splitPOS; // If $havingPOS, use it instead of $orderPOS.
$splitPOS = $groupPOS ? $groupPOS : $splitPOS; // If $groupPOS, use it instead of $havingPOS.
/* Set the conditon to be appened. */
/* Set the condition to be appended. */
$tableName = !empty($this->alias) ? $this->alias : $this->table;
if(!empty($this->app->config->cn2tw)) $lang = str_replace('zh-tw', 'zh-cn', $lang);
$langCondition = " $tableName.lang in('{$lang}', 'all') ";
/* If $spliPOS > 0, split the sql at $splitPOS. */
/* If $splitPOS > 0, split the sql at $splitPOS. */
if($splitPOS)
{
$firstPart = substr($sql, 0, $splitPOS);