正在显示
2 个修改的文件
包含
5 行增加
和
6 行删除
| @@ -36,17 +36,15 @@ class ProjectCountryController extends BaseController | @@ -36,17 +36,15 @@ class ProjectCountryController extends BaseController | ||
| 36 | 36 | ||
| 37 | public function custom(DomainInfoLogic $domainInfoLogic){ | 37 | public function custom(DomainInfoLogic $domainInfoLogic){ |
| 38 | $this->request->validate([ | 38 | $this->request->validate([ |
| 39 | - 'project_id'=>'required', | ||
| 40 | 'language_id'=>'required', | 39 | 'language_id'=>'required', |
| 41 | 'custom_domain'=>'required', | 40 | 'custom_domain'=>'required', |
| 42 | 'is_create'=>'required', | 41 | 'is_create'=>'required', |
| 43 | ],[ | 42 | ],[ |
| 44 | - 'project_id.required' => 'project_id不能为空', | ||
| 45 | 'language_id.required' => 'language_id不能为空', | 43 | 'language_id.required' => 'language_id不能为空', |
| 46 | 'custom_domain.required' => 'custom_domain不能为空', | 44 | 'custom_domain.required' => 'custom_domain不能为空', |
| 47 | 'is_create.required' => 'is_create不能为空', | 45 | 'is_create.required' => 'is_create不能为空', |
| 48 | ]); | 46 | ]); |
| 49 | - $domainInfoLogic->country_custom(); | 47 | + $domainInfoLogic->country_custom($this->user['project_id']); |
| 50 | $this->response('success'); | 48 | $this->response('success'); |
| 51 | } | 49 | } |
| 52 | } | 50 | } |
| @@ -352,9 +352,9 @@ class DomainInfoLogic extends BaseLogic | @@ -352,9 +352,9 @@ class DomainInfoLogic extends BaseLogic | ||
| 352 | return false; | 352 | return false; |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | - public function country_custom(){ | 355 | + public function country_custom($project_id){ |
| 356 | $project_model = new Project(); | 356 | $project_model = new Project(); |
| 357 | - $project_info = $project_model->read(['id'=>$this->param['project_id']],'serve_id'); | 357 | + $project_info = $project_model->read(['id'=>$project_id],'serve_id'); |
| 358 | if($project_info === false){ | 358 | if($project_info === false){ |
| 359 | $this->fail('获取项目数据失败'); | 359 | $this->fail('获取项目数据失败'); |
| 360 | } | 360 | } |
| @@ -374,8 +374,9 @@ class DomainInfoLogic extends BaseLogic | @@ -374,8 +374,9 @@ class DomainInfoLogic extends BaseLogic | ||
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | $custom_model = new CountryCustom(); | 376 | $custom_model = new CountryCustom(); |
| 377 | - $info = $custom_model->read(['project_id'=>$this->param['project_id'],'language_id'=>$this->param['language_id']]); | 377 | + $info = $custom_model->read(['project_id'=>$project_id,'language_id'=>$this->param['language_id']]); |
| 378 | if($info === false){ | 378 | if($info === false){ |
| 379 | + $this->param['project_id'] = $project_id; | ||
| 379 | $custom_model->add($this->param); | 380 | $custom_model->add($this->param); |
| 380 | }else{ | 381 | }else{ |
| 381 | $custom_model->edit($this->param,['id'=>$info['id']]); | 382 | $custom_model->edit($this->param,['id'=>$info['id']]); |
-
请 注册 或 登录 后发表评论