作者 lyh

变更数据

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