visuddhinanda пре 2 година
родитељ
комит
b15a208f3e
1 измењених фајлова са 8 додато и 1 уклоњено
  1. 8 1
      app/Console/Commands/UpgradeDict.php

+ 8 - 1
app/Console/Commands/UpgradeDict.php

@@ -67,13 +67,20 @@ class UpgradeDict extends Command
 									$this->error("not uuid");
 									continue;
 								}
+                                //读取 description
+                                $desFile = $dir."/description.md";
+                                if(file_exists($desFile)){
+                                    $description = file_get_contents($desFile);
+                                }else{
+                                    $description = $this->dictInfo['meta']['description'];
+                                }
 								$tableDict = DictInfo::firstOrNew([
 									"id" => $this->dictInfo['meta']['uuid']
 								]);
 								$tableDict->id = $this->dictInfo['meta']['uuid'];
 								$tableDict->name = $this->dictInfo['meta']['dictname'];
 								$tableDict->shortname = $this->dictInfo['meta']['shortname'];
-								$tableDict->description = $this->dictInfo['meta']['description'];
+								$tableDict->description = $description;
 								$tableDict->src_lang = $this->dictInfo['meta']['src_lang'];
 								$tableDict->dest_lang = $this->dictInfo['meta']['dest_lang'];
 								$tableDict->rows = $this->dictInfo['meta']['rows'];