From cbb7dc3528b2c9b3ae725c8d633107ea459ff218 Mon Sep 17 00:00:00 2001 From: Alone <675061370@qq.com> Date: Fri, 29 Nov 2024 09:08:19 +0800 Subject: [PATCH] 1 --- app/api/controller/Other.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Other.php b/app/api/controller/Other.php index 6ba6c5e..9e1b8f7 100644 --- a/app/api/controller/Other.php +++ b/app/api/controller/Other.php @@ -233,8 +233,13 @@ class Other extends QfShop $this->model->where($map)->chunk(100, function ($order) { foreach ($order as $value) { $deles = $value->toArray(); - $filelist = []; - $filelist[] = $deles['fid']; + // $filelist = []; + // $filelist[] = $deles['fid']; + + $fid = $deles['fid']; + + // 尝试解码,如果是有效的 JSON 数组则使用,否则转为单元素数组 + $filelist = (is_string($fid) && ($decodedFid = json_decode($fid, true)) && is_array($decodedFid)) ? $decodedFid : (array)$fid; $urlData = array(