From 345e2391b12e015e51adb97e7145bb7f9bfb8665 Mon Sep 17 00:00:00 2001 From: "HESU\\HESU" <1696136552@qq.com> Date: Fri, 4 Jul 2025 14:21:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6oss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ticket/service/CategorieService.php | 6 +++--- app/ticket/service/TicketService.php | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/ticket/service/CategorieService.php b/app/ticket/service/CategorieService.php index 5a0e9ee..a6843e1 100644 --- a/app/ticket/service/CategorieService.php +++ b/app/ticket/service/CategorieService.php @@ -13,9 +13,9 @@ class CategorieService public function list($params) { $result = (new CategorieLogic())->list($params); - + $value=$result[0]->toArray(); foreach ($result as $key => &$value) { - $value['name'] = isset($item['translation']) ? $item['translation']['name'] : ''; + $value['name'] = isset($value['translation']) ? $value['translation']['name'] : ''; unset($value['translation']); } unset($value); @@ -27,7 +27,7 @@ class CategorieService { $result = (new CategorieLogic())->getAll($params); foreach ($result as $key => &$value) { - $value['name'] =isset($item['translation']) ? $item['translation']['name'] : ''; + $value['name'] = isset($value['translation']) ? $value['translation']['name'] : ''; unset($value['translation']); } unset($value); diff --git a/app/ticket/service/TicketService.php b/app/ticket/service/TicketService.php index a20c20b..98ad7b1 100644 --- a/app/ticket/service/TicketService.php +++ b/app/ticket/service/TicketService.php @@ -17,6 +17,14 @@ class TicketService public function list($params) { $res = (new TicketLogic())->list($params); + foreach ($res as $k => &$v) { + foreach ($v['attachments'] as &$attachments) { + $attachments['storage_path_full'] = (new \app\common\service\OssService())->generatePrivateUrl($attachments['storage_path']); + } + } + unset($v); + unset($attachments); + return $res; }