AddDevelop:添加开发内容

添加数据库恢复备份功能,后期将会移除

Signed-off-by: XiaoLFeng <gm@x-lf.cn>
This commit is contained in:
筱锋xiao_lfeng 2023-07-08 16:37:57 +08:00
parent 3612f23842
commit 5f0fa57c91
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,40 @@
<?php
/*
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
* 开发开源遵循 MIT 许可,若需商用请联系开发者
* https://www.x-lf.com/
*/
namespace App\Http\Controllers;
use Illuminate\Support\Facades\DB;
class DataBase extends Controller
{
public function __construct()
{
DB::statement("TRUNCATE TABLE `xf_index`.`blog_link`");
$result = DB::table('xf_blog_friends')
->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'),
]);
}
}
}

View File

@ -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');