diff --git a/app/console/controller/CommentController.php b/app/console/controller/CommentController.php index 392d834..3201dd0 100644 --- a/app/console/controller/CommentController.php +++ b/app/console/controller/CommentController.php @@ -40,7 +40,7 @@ class CommentController extends BaseController protected function postProcessItem(array $item, string $scene): array { - if ($scene === 'default') { + if ($scene === 'default' || $scene === 'show') { if ($item['avatar']) { $item['avatar_full'] = (new \app\mzl\modules\upload\service\OssService())->generatePrivateUrl($item['avatar']); } diff --git a/app/console/service/CommentService.php b/app/console/service/CommentService.php index 408bdd8..75e1635 100644 --- a/app/console/service/CommentService.php +++ b/app/console/service/CommentService.php @@ -47,12 +47,9 @@ class CommentService extends BaseService 'show' => function ($params) { return [ 'filters' => [ - ['field' => 'status', 'operator' => '=', 'value' => '1'], ['field' => 'id', 'operator' => '=', 'value' => $params['id']] ], 'fields' => ['id', 'article_id', 'content', 'avatar', 'name', 'created_at', 'updated_at'], - 'relations' => [ - ], ]; } ];