|
...
|
...
|
@@ -1126,16 +1126,16 @@ class ProjectController extends BaseController |
|
|
|
public function saveSiteStatus(){
|
|
|
|
$projectModel = new Project();
|
|
|
|
$this->request->validate([
|
|
|
|
'project_id'=>'required',
|
|
|
|
'id'=>'required',
|
|
|
|
'site_status'=>'required'
|
|
|
|
],[
|
|
|
|
'project_id.required' => '项目id不能为空',
|
|
|
|
'id.required' => '项目id不能为空',
|
|
|
|
'site_status.required' => '状态不能为空',
|
|
|
|
]);
|
|
|
|
$projectModel->edit(['site_status'=>$this->map['site_status']],['id'=>$this->param['project_id']]);
|
|
|
|
$projectModel->edit(['site_status'=>$this->map['site_status']],['id'=>$this->param['id']]);
|
|
|
|
//TODO::通知C端
|
|
|
|
$domainModel = new DomainInfoModel();
|
|
|
|
$domainInfo = $domainModel->read(['project_id'=>$this->param['project_id']]);
|
|
|
|
$domainInfo = $domainModel->read(['project_id'=>$this->param['id']]);
|
|
|
|
if($domainInfo !== false){
|
|
|
|
$rs = curl_get('https://'.$domainInfo['domain'].'/api/stop_or_start_website/');
|
|
|
|
@file_put_contents(storage_path('logs/site_status.log'), var_export('通知C端on/off'.$domainInfo['domain'].'.返回结果:'.json_encode($rs), true) . PHP_EOL, FILE_APPEND);
|
...
|
...
|
|