作者 lyh

gx

@@ -25,13 +25,10 @@ class CopyImageFileListener implements ShouldQueue @@ -25,13 +25,10 @@ class CopyImageFileListener implements ShouldQueue
25 */ 25 */
26 public function handle(CopyImageFile $event) 26 public function handle(CopyImageFile $event)
27 { 27 {
28 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('进入', true) . PHP_EOL, FILE_APPEND);  
29 $this->param = $event->data; 28 $this->param = $event->data;
30 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($this->param, true) . PHP_EOL, FILE_APPEND);  
31 $imageModel = new ImageModel(); 29 $imageModel = new ImageModel();
32 //获取当前项目的所有图片 30 //获取当前项目的所有图片
33 $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos']); 31 $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos']);
34 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($imageList, true) . PHP_EOL, FILE_APPEND);  
35 if(!empty($imageList)){ 32 if(!empty($imageList)){
36 $amazonS3Service = new AmazonS3Service(); 33 $amazonS3Service = new AmazonS3Service();
37 foreach ($imageList as $k => $v){ 34 foreach ($imageList as $k => $v){
@@ -76,6 +76,7 @@ class AmazonS3Service @@ -76,6 +76,7 @@ class AmazonS3Service
76 ]); 76 ]);
77 return $result['ObjectURL']; 77 return $result['ObjectURL'];
78 } catch (AwsException $e) { 78 } catch (AwsException $e) {
  79 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('图片:'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);
79 return '上传文件到S3时发生错误:' . $e->getMessage(); 80 return '上传文件到S3时发生错误:' . $e->getMessage();
80 } 81 }
81 } 82 }