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