作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

@@ -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){
@@ -67,6 +67,8 @@ class AmazonS3Service @@ -67,6 +67,8 @@ class AmazonS3Service
67 public function syncImageFiles($files) 67 public function syncImageFiles($files)
68 { 68 {
69 $key = str_replace_url($files); 69 $key = str_replace_url($files);
  70 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($key, true) . PHP_EOL, FILE_APPEND);
  71 +
70 $body = $files; 72 $body = $files;
71 try { 73 try {
72 $result = $this->s3->putObject([ 74 $result = $this->s3->putObject([
@@ -76,6 +78,7 @@ class AmazonS3Service @@ -76,6 +78,7 @@ class AmazonS3Service
76 ]); 78 ]);
77 return $result['ObjectURL']; 79 return $result['ObjectURL'];
78 } catch (AwsException $e) { 80 } catch (AwsException $e) {
  81 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('图片:'.$e->getMessage(), true) . PHP_EOL, FILE_APPEND);
79 return '上传文件到S3时发生错误:' . $e->getMessage(); 82 return '上传文件到S3时发生错误:' . $e->getMessage();
80 } 83 }
81 } 84 }