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