正在显示
1 个修改的文件
包含
6 行增加
和
6 行删除
| @@ -242,6 +242,11 @@ class OptimizeController extends BaseController | @@ -242,6 +242,11 @@ class OptimizeController extends BaseController | ||
| 242 | 'robots.required' => 'robots不能为空', | 242 | 'robots.required' => 'robots不能为空', |
| 243 | 'project_id.required' => 'project_id不能为空', | 243 | 'project_id.required' => 'project_id不能为空', |
| 244 | ]); | 244 | ]); |
| 245 | + $projectModel = new Project(); | ||
| 246 | + $rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]); | ||
| 247 | + if($rs === false){ | ||
| 248 | + $this->response('执行错误,请联系开发人员',Code::SYSTEM_ERROR); | ||
| 249 | + } | ||
| 245 | //TODO::通知C端 | 250 | //TODO::通知C端 |
| 246 | $projectLogic = new ProjectLogic(); | 251 | $projectLogic = new ProjectLogic(); |
| 247 | $project = $projectLogic->getProjectInfo($this->param['project_id']); | 252 | $project = $projectLogic->getProjectInfo($this->param['project_id']); |
| @@ -254,11 +259,6 @@ class OptimizeController extends BaseController | @@ -254,11 +259,6 @@ class OptimizeController extends BaseController | ||
| 254 | if(empty($res) || $res['status'] != 200){ | 259 | if(empty($res) || $res['status'] != 200){ |
| 255 | $this->response('生成robots失败,请联系开发人员',Code::SYSTEM_ERROR,['url'=>$url]); | 260 | $this->response('生成robots失败,请联系开发人员',Code::SYSTEM_ERROR,['url'=>$url]); |
| 256 | } | 261 | } |
| 257 | - $projectModel = new Project(); | ||
| 258 | - $rs = $projectModel->edit(['robots'=>$this->param['robots']],['id'=>$this->param['project_id']]); | ||
| 259 | - if($rs === false){ | ||
| 260 | - $this->response('系统错误,请联系管理员',Code::SYSTEM_ERROR); | ||
| 261 | - } | ||
| 262 | - $this->response('success'); | 262 | + $this->response('success',Code::SUCCESS,['url'=>$domain.'robots.txt']); |
| 263 | } | 263 | } |
| 264 | } | 264 | } |
-
请 注册 或 登录 后发表评论