作者 lyh

hx

... ... @@ -41,7 +41,10 @@ class WebSettingController extends BaseController
* @time :2023/8/1 9:33
*/
public function sendNotify(WebSettingLogic $webSettingLogic){
http_get($webSettingLogic->sendNotifyMessage());
$list = $webSettingLogic->sendNotifyMessage();
if(!empty($list)){
$this->response('当前页面正在生成了,请完成后再点击',Code::SUCCESS,$list);
}
$this->response('success');
}
}
... ...
... ... @@ -67,12 +67,13 @@ class WebSettingLogic extends BaseLogic
public function sendNotifyMessage(){
//获取当前项目所有未处理的更新并更换为1:处理中 2:处理完成
$updateNotifyModel = new UpdateNotify();
$info = $updateNotifyModel->read(['project_id'=>$this->user['project_id'],'status'=>0]);
if($info !== false){
$this->fail('当前页面正在生成中,请勿重复点击');
$list = $updateNotifyModel->list(['project_id'=>$this->user['project_id'],'status'=>1]);
if(!empty($list)){
return $this->success($list);
}
$updateNotifyModel->edit(['status'=>1],['project_id'=>$this->user['project_id'],'status'=>0]);
$urlStr = $this->user['domain'].'api/updateHtmlNotify?project_id='.$this->user['project_id'];
return $urlStr;
http_get($urlStr);
return $this->success();
}
}
... ...