|
@@ -60,20 +60,22 @@ class Downloads extends Command
|
|
if(!$download) exit;
|
|
if(!$download) exit;
|
|
|
|
|
|
if($download->download_type == 'post'){
|
|
if($download->download_type == 'post'){
|
|
- $filePath = $fileDir .'内容-'.Carbon::now()->format('Y-m-d') .'_' .uniqid() .'.csv';
|
|
|
|
|
|
+ $filePath = $fileDir .$download->username.'内容-'.Carbon::now()->format('Y-m-d') .'_' .uniqid() .'.csv';
|
|
}elseif($download->download_type == 'post_waste'){
|
|
}elseif($download->download_type == 'post_waste'){
|
|
- $filePath = $fileDir .'回收站内容-'.Carbon::now()->format('Y-m-d') .'_' .uniqid() .'.csv';
|
|
|
|
|
|
+ $filePath = $fileDir .$download->username.'回收站内容-'.Carbon::now()->format('Y-m-d') .'_' .uniqid() .'.csv';
|
|
}else{
|
|
}else{
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
|
|
+ $download->download_status = 1;
|
|
|
|
+ $download->save();
|
|
|
|
|
|
try {
|
|
try {
|
|
$this->postRepository->download($filePath, $download->download_type, json_decode($download->params, true));
|
|
$this->postRepository->download($filePath, $download->download_type, json_decode($download->params, true));
|
|
$download->url = $filePath;
|
|
$download->url = $filePath;
|
|
- $download->download_status = 1;
|
|
|
|
|
|
+ $download->download_status = 2;
|
|
$download->save();
|
|
$download->save();
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
- $download->download_status = 2;
|
|
|
|
|
|
+ $download->download_status = 3;
|
|
$download->url = $e->getMessage();
|
|
$download->url = $e->getMessage();
|
|
$download->save();
|
|
$download->save();
|
|
}
|
|
}
|