正在显示
1 个修改的文件
包含
4 行增加
和
2 行删除
| @@ -39,20 +39,22 @@ class CopyImageFileJob implements ShouldQueue | @@ -39,20 +39,22 @@ class CopyImageFileJob implements ShouldQueue | ||
| 39 | { | 39 | { |
| 40 | $imageModel = new ImageModel(); | 40 | $imageModel = new ImageModel(); |
| 41 | //获取当前项目的所有图片 | 41 | //获取当前项目的所有图片 |
| 42 | - $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']); | 42 | + $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size','name']); |
| 43 | if(!empty($imageList)){ | 43 | if(!empty($imageList)){ |
| 44 | $amazonS3Service = new AmazonS3Service(); | 44 | $amazonS3Service = new AmazonS3Service(); |
| 45 | foreach ($imageList as $k => $v){ | 45 | foreach ($imageList as $k => $v){ |
| 46 | + echo date('Y-m-d H:i:s') . '执行图片的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL; | ||
| 46 | $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); | 47 | $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); |
| 47 | $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]); | 48 | $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]); |
| 48 | } | 49 | } |
| 49 | } | 50 | } |
| 50 | 51 | ||
| 51 | $fileModel = new FileModel(); | 52 | $fileModel = new FileModel(); |
| 52 | - $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos']); | 53 | + $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']); |
| 53 | if(!empty($fileList)){ | 54 | if(!empty($fileList)){ |
| 54 | $amazonS3Service = new AmazonS3Service(); | 55 | $amazonS3Service = new AmazonS3Service(); |
| 55 | foreach ($fileList as $k => $v){ | 56 | foreach ($fileList as $k => $v){ |
| 57 | + echo date('Y-m-d H:i:s') . '执行文件的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL; | ||
| 56 | $amazonS3Service->syncImageFiles(getFileUrl($v['path'])); | 58 | $amazonS3Service->syncImageFiles(getFileUrl($v['path'])); |
| 57 | $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]); | 59 | $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]); |
| 58 | } | 60 | } |
-
请 注册 或 登录 后发表评论