where("key",$param["key"])->select(); if ($uploadData->isEmpty()) return true; foreach ($uploadData as $file) { if (file_exists(public_path().$file['path'])) { unlink(public_path().$file['path']); } } $uploadData->delete(); // 清理数据库 return true; } catch (\Throwable $th) { echo "清理上传文件报错\n"; echo $th->getLine()."\n"; echo $th->getFile()."\n"; echo $th->getMessage()."\n"; return false; } } }