文件删除
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user