diff --git a/app/Http/Controllers/Function/Link.php b/app/Http/Controllers/Function/Link.php index 43b2e06..11097ff 100644 --- a/app/Http/Controllers/Function/Link.php +++ b/app/Http/Controllers/Function/Link.php @@ -784,16 +784,21 @@ protected function viewEditFriend(HttpRequest $request, $friendId): Application| protected function viewLink(): Factory|View|Application { $this->data['webSubTitle'] = '友链'; - $this->getFriendsLink($this->data); + $this->data['blogLink'] = DB::table('blog_link') + ->whereNotIn('blog_link.blogLocation', [0]) + ->get() + ->toArray(); + $this->data['blogSort'] = DB::table('blog_sort') + ->orderBy('blog_sort.sort') + ->get() + ->toArray(); + $this->data['blogColor'] = DB::table('blog_color') + ->orderBy('id') + ->get() + ->toArray(); return view('function.link', $this->data); } - private function getFriendsLink(array &$data): void - { - $data['blogLink'] = DB::table('blog_link')->whereNotIn('blog_link.blogLocation', [0])->get()->toArray(); - $data['blogSort'] = DB::table('blog_sort')->orderBy('blog_sort.sort')->get()->toArray(); - } - protected function viewMakeFriend(): Factory|View|Application { $this->data['webSubTitle'] = '添加友链'; diff --git a/resources/views/function/link.blade.php b/resources/views/function/link.blade.php index 9679d47..f163147 100644 --- a/resources/views/function/link.blade.php +++ b/resources/views/function/link.blade.php @@ -23,14 +23,19 @@ class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translat @foreach($blogSort as $valueSort)