diff --git a/app/Http/Controllers/DataBase.php b/app/Http/Controllers/DataBase.php new file mode 100644 index 0000000..fc73829 --- /dev/null +++ b/app/Http/Controllers/DataBase.php @@ -0,0 +1,40 @@ +orderBy('id') + ->get() + ->toArray(); + foreach ($result as $value) { + $value->blog_rss_judge ? $value->blog_rss_judge = 1 : $value->blog_rss_judge = 0; + DB::table('blog_link') + ->insert([ + 'blogName' => $value->blog_name, + 'blogUrl' => $value->blog_url, + 'blogDescription' => $value->blog_introduce, + 'blogOwnEmail' => $value->blog_owner_email, + 'blogIcon' => $value->blog_icon, + 'blogRssJudge' => $value->blog_rss_judge, + 'blogRSS' => $value->blog_rss, + 'blogServerHost' => $value->blog_serverhost, + 'blogLocation' => $value->blog_location, + 'blogSetColor' => $value->blog_sel_color, + 'created_at' => date('Y-m-d H:i:s'), + ]); + } + } +} diff --git a/routes/web.php b/routes/web.php index 0237933..3d326f6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -26,7 +26,8 @@ */ Route::get('/', [Index::class,'ViewIndex'])->name('home'); -Route::get('about',[Index::class,'ViewAboutMe'])->name('about'); +Route::get('about', [Index::class, 'ViewAboutMe'])->name('about'); +Route::get('backup', [\App\Http\Controllers\DataBase::class, '__construct']); Route::prefix('function')->group(function () { Route::get('link',[UserLink::class, 'viewLink'])->name('function.link');