From 6facfcf8942432902177598c6ea490cb73cf921e Mon Sep 17 00:00:00 2001 From: Chrisleung <showerlzy@gmail.com> Date: Sun, 24 Mar 2019 09:52:16 +0800 Subject: [PATCH] 修复当表字段注释为空时,生成的语言文件格式错误 --- application/admin/command/Crud.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php index 8eed578..1664f55 100755 --- a/application/admin/command/Crud.php +++ b/application/admin/command/Crud.php @@ -807,7 +807,7 @@ class Crud extends Command } } unset($line); - $langList = implode(",\n", array_filter($langList)) . ","; + $langList = implode(",\n", array_filter($langList)); //表注释 $tableComment = $modelTableInfo['Comment']; @@ -934,9 +934,7 @@ class Crud extends Command // 生成JS文件 $this->writeToFile('javascript', $data, $javascriptFile); // 生成语言文件 - if ($langList) { - $this->writeToFile('lang', $data, $langFile); - } + $this->writeToFile('lang', $data, $langFile); } catch (ErrorException $e) { throw new Exception("Code: " . $e->getCode() . "\nLine: " . $e->getLine() . "\nMessage: " . $e->getMessage() . "\nFile: " . $e->getFile()); } -- libgit2 0.24.0