|
@@ -31,13 +31,13 @@ class ExtendLogic extends BaseLogic |
|
@@ -31,13 +31,13 @@ class ExtendLogic extends BaseLogic |
|
31
|
* @time :2023/11/9 14:29
|
31
|
* @time :2023/11/9 14:29
|
|
32
|
*/
|
32
|
*/
|
|
33
|
public function extendSave(){
|
33
|
public function extendSave(){
|
|
|
|
34
|
+ if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
35
|
+ $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
36
|
+ }else{
|
|
34
|
$info = $this->model->read(['title'=>$this->param['title']]);
|
37
|
$info = $this->model->read(['title'=>$this->param['title']]);
|
|
35
|
if($info !== false){
|
38
|
if($info !== false){
|
|
36
|
$this->fail('当前扩展名称已存在');
|
39
|
$this->fail('当前扩展名称已存在');
|
|
37
|
}
|
40
|
}
|
|
38
|
- if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
39
|
- $rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
40
|
- }else{
|
|
|
|
41
|
$key = trim(strtolower(preg_replace('/[\W]+/', '-', trim(Translate::tran($this->param['title'], 'en')))), '-');
|
41
|
$key = trim(strtolower(preg_replace('/[\W]+/', '-', trim(Translate::tran($this->param['title'], 'en')))), '-');
|
|
42
|
$this->param['key'] = $this->getKey($key);
|
42
|
$this->param['key'] = $this->getKey($key);
|
|
43
|
$this->param['project_id'] = $this->user['project_id'];
|
43
|
$this->param['project_id'] = $this->user['project_id'];
|
|
@@ -46,7 +46,7 @@ class ExtendLogic extends BaseLogic |
|
@@ -46,7 +46,7 @@ class ExtendLogic extends BaseLogic |
|
46
|
if($rs === false){
|
46
|
if($rs === false){
|
|
47
|
$this->fail('error');
|
47
|
$this->fail('error');
|
|
48
|
}
|
48
|
}
|
|
49
|
- return $this->success();
|
49
|
+ return $this->success($this->param);
|
|
50
|
}
|
50
|
}
|
|
51
|
|
51
|
|
|
52
|
/**
|
52
|
/**
|