作者 lyh
@@ -258,6 +258,7 @@ class FileController @@ -258,6 +258,7 @@ class FileController
258 'mime'=>$mime, 258 'mime'=>$mime,
259 'project_id'=>$this->cache['project_id'] ?? 0, 259 'project_id'=>$this->cache['project_id'] ?? 0,
260 'name'=>$name, 260 'name'=>$name,
  261 + 'en_name'=>$fileName
261 ]; 262 ];
262 $rs = $fileModel->add($data); 263 $rs = $fileModel->add($data);
263 if ($rs === false) { 264 if ($rs === false) {
@@ -289,6 +289,7 @@ class ImageController extends Controller @@ -289,6 +289,7 @@ class ImageController extends Controller
289 'mime'=>$mime, 289 'mime'=>$mime,
290 'project_id'=>$this->cache['project_id'] ?? 0, 290 'project_id'=>$this->cache['project_id'] ?? 0,
291 'name'=>$name, 291 'name'=>$name,
  292 + 'en_name'=>$fileName
292 ]; 293 ];
293 $rs = $imageModel->add($data); 294 $rs = $imageModel->add($data);
294 if ($rs === false) { 295 if ($rs === false) {
@@ -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 }