From 03bd00c545789e9edbbb2ac2dca723d7cae52f33 Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Fri, 2 Apr 2021 10:19:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/Category/IndexController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Admin/Controllers/Category/IndexController.php b/app/Admin/Controllers/Category/IndexController.php index 156dd5b..b30bcb7 100644 --- a/app/Admin/Controllers/Category/IndexController.php +++ b/app/Admin/Controllers/Category/IndexController.php @@ -40,7 +40,7 @@ class IndexController extends AdminController ->when('show', function (WidgetsForm $form) { $form->select('article_id', '关联文章') ->options(function ($option, $info) { - return Article::whereHas('category', function ($q) { + return Article::whereHas('categories', function ($q) { $q->where('type', 'show'); })->pluck('title', 'id'); })->help('当分类类型是文章详情的时候需要选择关联文章'); @@ -107,7 +107,7 @@ class IndexController extends AdminController ->when('show', function (Form $form) { $form->select('article_id', '关联文章') ->options(function ($option, $info) { - return Article::whereHas('category', function ($q) { + return Article::whereHas('categories', function ($q) { $q->where('type', 'show'); })->pluck('title', 'id'); })->help('当分类类型是文章详情的时候需要选择关联文章');