作者 lyh

变更数据

@@ -31,18 +31,17 @@ class SyncFile extends Command @@ -31,18 +31,17 @@ class SyncFile extends Command
31 31
32 public function handle(){ 32 public function handle(){
33 $errorFileModel = new ErrorFile(); 33 $errorFileModel = new ErrorFile();
34 - $lists = $errorFileModel->list(['status'=>0]);//未同步成功的图片及文件 34 + $lists = $errorFileModel->list(['status'=>0],'id',['id','path'],'asc',1000);//未同步成功的图片及文件
35 foreach ($lists as $k => $v){ 35 foreach ($lists as $k => $v){
36 if(strpos($v['path'], '/181/') !== false ){ 36 if(strpos($v['path'], '/181/') !== false ){
37 $code = $this->synchronizationFiles($v['path']); 37 $code = $this->synchronizationFiles($v['path']);
38 }else{ 38 }else{
39 $code = $this->synchronizationFile($v['path']); 39 $code = $this->synchronizationFile($v['path']);
40 } 40 }
41 -// echo date('Y-m-d H:i:s') . 'code:'. $code . PHP_EOL;  
42 -// if((int)$code == 200){  
43 -// echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;  
44 -// $errorFileModel->edit(['status'=>1],['id'=>$v['id']]);  
45 -// } 41 + if(200 == (int)$code){
  42 + echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
  43 + $errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
  44 + }
46 } 45 }
47 echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL; 46 echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL;
48 return true; 47 return true;