request->get('id'); $returns = array(); $path = "./public/storage/goods-img/" . $id; $files = scandir($path); for($i = 0; $i < count($files); $i++){ if($files[$i] != "." && $files[$i] != ".." && strtolower($files[$i]) != "cover.jpg"){ $returns[] = "http://op.wanyuewellness.cn/storage/goods-img/".$id."/".$files[$i]; } } return json_encode($returns); } }