作者 lyh

gx

... ... @@ -45,26 +45,25 @@ class CNoticeController extends BaseController
'url' => $request->input('url', []),
'language'=> $request->input('language', []),
];
$result = http_post($url, json_encode($param));
return $this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
$updateProgressModel = new UpdateProgress();
$progressInfo = $updateProgressModel->formatQuery(['project_id'=>$this->user['project_id'],'type'=>$this->param['type']])->orderBy('id','desc')->first();
if((!empty($progressInfo))){
$progressInfo = $progressInfo->toArray();
if(($progressInfo['total_num'] > $progressInfo['current_num'])){
$this->response('当前页面正在生成了,请完成后再点击',Code::SUCCESS,$progressInfo);
}
}
//通知更新
if($this->param['type'] == UpdateNotify::TYPE_MASTER){
$this->updateMaster();
}else{
$this->updateMinorLanguages();
}
$urlStr = $this->getString($this->param['type'],$this->param['page']);
curlGet($urlStr);
$this->response('更新成功');
http_post($url, json_encode($param));
$this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
// $updateProgressModel = new UpdateProgress();
// $progressInfo = $updateProgressModel->formatQuery(['project_id'=>$this->user['project_id'],'type'=>$this->param['type']])->orderBy('id','desc')->first();
// if((!empty($progressInfo))){
// $progressInfo = $progressInfo->toArray();
// if(($progressInfo['total_num'] > $progressInfo['current_num'])){
// $this->response('当前页面正在生成了,请完成后再点击',Code::SUCCESS,$progressInfo);
// }
// }
// //通知更新
// if($this->param['type'] == UpdateNotify::TYPE_MASTER){
// $this->updateMaster();
// }else{
// $this->updateMinorLanguages();
// }
// $urlStr = $this->getString($this->param['type'],$this->param['page']);
// curlGet($urlStr);
// $this->response('更新成功');
}
/**
... ...