From 92118af7df9c35d627aa1035f60c10fc6fd3db89 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 1 Sep 2020 13:42:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E7=94=9Fes=E7=94=A8=E7=9A=84=E5=88=86?= =?UTF-8?q?=E8=AF=8D=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++- app/Console/Commands/GenEsDicts.php | 54 +++++++++++++++++++++++++++++ app/Models/EsDict.php | 11 ++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 app/Console/Commands/GenEsDicts.php create mode 100644 app/Models/EsDict.php diff --git a/.gitignore b/.gitignore index 6d02a28..3fa94ca 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,7 @@ yarn-error.log .idea .vscode/launch.json /storage/debugbar -/public/certs \ No newline at end of file +/public/certs +/public/es_dicts.txt +/public/es_use_dicts.txt +/public/es_unuse_dicts.txt \ No newline at end of file diff --git a/app/Console/Commands/GenEsDicts.php b/app/Console/Commands/GenEsDicts.php new file mode 100644 index 0000000..47fbdea --- /dev/null +++ b/app/Console/Commands/GenEsDicts.php @@ -0,0 +1,54 @@ +pluck('title')->toArray(); + //dd($es); + $es = implode("\n",$es); + $file_path = public_path() . '/es_use_dicts.txt'; + file_put_contents($file_path,$es); + + $es = EsDict::whereNotNull('deleted_at')->pluck('title')->toArray(); + $es = implode("\n",$es); + $file_path = public_path() . '/es_unuse_dicts.txt'; + file_put_contents($file_path,$es); + return 0; + } +} diff --git a/app/Models/EsDict.php b/app/Models/EsDict.php new file mode 100644 index 0000000..0cce8b3 --- /dev/null +++ b/app/Models/EsDict.php @@ -0,0 +1,11 @@ +