* Fix bug.

This commit is contained in:
Yagami
2020-12-17 17:33:03 +08:00
parent 21299938d1
commit 8efb436503
+2 -10
View File
@@ -613,20 +613,12 @@ class customModel extends model
$this->setting->setItem('system.custom.sprintConcept', $this->post->sprintConcept);
/* Change block title. */
$oldConfig = isset($this->config->custom->sprintConcept) ? $this->config->custom->sprintConcept : '0_0';
$oldConfig = isset($this->config->custom->sprintConcept) ? $this->config->custom->sprintConcept : '0';
$newConfig = $this->post->sprintConcept;
list($oldProductIndex, $oldProjectIndex) = explode('_', $oldConfig);
list($newProductIndex, $newProjectIndex) = explode('_', $newConfig);
foreach($this->config->productCommonList as $clientLang => $productCommonList)
{
$this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$productCommonList[$oldProductIndex]}', '{$productCommonList[$newProductIndex]}')")->where('source')->eq('product')->exec();
}
foreach($this->config->projectCommonList as $clientLang => $projectCommonList)
{
$this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$projectCommonList[$oldProjectIndex]}', '{$projectCommonList[$newProjectIndex]}')")->where('source')->eq('project')->exec();
$this->dao->update(TABLE_BLOCK)->set("`title` = REPLACE(`title`, '{$projectCommonList[$oldConfig]}', '{$projectCommonList[$newConfig]}')")->where('source')->eq('project')->exec();
}
}