From 367836f54b52e119bb5cf39688bf6c837526feb7 Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Sun, 4 Feb 2024 11:47:38 +0800 Subject: [PATCH] 1 --- app/api/controller/Recovery.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/api/controller/Recovery.php b/app/api/controller/Recovery.php index 9bb6b9b8..156bab7b 100644 --- a/app/api/controller/Recovery.php +++ b/app/api/controller/Recovery.php @@ -302,9 +302,19 @@ class Recovery extends Controller if (!$order_id) { return $this->renderError('缺少必要参数'); } - $imageIds = $this->request->post('image_ids'); + $image_str = $this->request->post('image_ids'); + $imageIds = []; + if ($image_str) { + if (!is_array($image_str)) { + $imageIds = explode(',', $image_str); + } else { + $imageIds = $image_str; + } + } if ($imageIds && !is_array($imageIds)) { $imageIds = explode(',', $imageIds); + } else { + $imageIds = []; } $shop_id = intval($this->request->post('shop_id')); if (!$shop_id) {