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) {