文件删除

This commit is contained in:
2025-09-10 15:02:11 +08:00
parent e59a690c31
commit b120337987
+11 -3
View File
@@ -142,7 +142,9 @@ class UploadedFilesService
*/
public function getFile(array $where)
{
$file = $this->logicShow(['where' => $where]);
$config['model'] = $this->modelClass;
$config['where'] = $where;
$file = $this->logicShow($config);
if (!$file) {
return false;
@@ -159,14 +161,20 @@ class UploadedFilesService
*/
public function deleteFile(int $fileId): bool
{
$file = $this->logicShow(['where' => ['id' => $fileId]]);
$config['model'] = $this->modelClass;
$config['where'] = ['id' => $fileId];
$file = $this->logicShow($config);
if (!$file) {
return false;
}
// 删除数据库记录
return $this->logicDeleteBy(['where' => ['id' => $fileId]]);
$config =[
'model' => $this->modelClass,
'where' => ['id' => $fileId],
];
return $this->logicDeleteBy($config);
}
/**