|
|
@ -7,6 +7,7 @@ use backend\modules\file\models\ars\File; |
|
|
|
use backend\modules\file\models\ars\TemFile; |
|
|
|
use yii\web\HttpException; |
|
|
|
use yii; |
|
|
|
use yii\web\ServerErrorHttpException; |
|
|
|
|
|
|
|
class FileManager |
|
|
|
{ |
|
|
@ -46,7 +47,8 @@ class FileManager |
|
|
|
* @param $ownId |
|
|
|
* @param $ownType |
|
|
|
* @return array|bool |
|
|
|
* @throws \Exception |
|
|
|
* @throws HttpException |
|
|
|
* @throws ServerErrorHttpException |
|
|
|
* 根据临时文件id将临时文件保存在文件中 |
|
|
|
*/ |
|
|
|
public function saveTemFileToFile($temFileIdArr, $ownId, $ownType) |
|
|
@ -71,9 +73,9 @@ class FileManager |
|
|
|
|
|
|
|
$tra->commit(); |
|
|
|
return ['status' => true, 'info' => '保存成功', 'first_file_id' => $firstFileId]; |
|
|
|
} catch (\Exception $e) { |
|
|
|
} catch (yii\db\Exception $e) { |
|
|
|
$tra->rollBack(); |
|
|
|
throw new \Exception($e->getMessage()); |
|
|
|
throw new ServerErrorHttpException($e->getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|