|
@@ -34,8 +34,14 @@ class ProjectCountryLogic extends BaseLogic |
|
@@ -34,8 +34,14 @@ class ProjectCountryLogic extends BaseLogic |
|
34
|
* @method :post
|
34
|
* @method :post
|
|
35
|
* @time :2023/4/28 17:42
|
35
|
* @time :2023/4/28 17:42
|
|
36
|
*/
|
36
|
*/
|
|
37
|
- public function country_edit(){
|
|
|
|
38
|
- $rs = $this->model->edit($this->param,['project_id'=>$this->user['project_id']]);
|
37
|
+ public function country_save(){
|
|
|
|
38
|
+ $info = $this->model->read(['project_id'=>$this->user['project_id']]);
|
|
|
|
39
|
+ if($info === false){
|
|
|
|
40
|
+ $this->param['project_id'] = $this->user['project_id'];
|
|
|
|
41
|
+ $rs = $this->model->add($this->param);
|
|
|
|
42
|
+ }else{
|
|
|
|
43
|
+ $rs = $this->model->edit($this->param,['project_id'=>$this->user['project_id']]);
|
|
|
|
44
|
+ }
|
|
39
|
if($rs === false){
|
45
|
if($rs === false){
|
|
40
|
$this->fail('当前数据不存在');
|
46
|
$this->fail('当前数据不存在');
|
|
41
|
}
|
47
|
}
|