|
...
|
...
|
@@ -38,7 +38,8 @@ class ExtendLogic extends BaseLogic |
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
}else{
|
|
|
|
$this->getKey(Translate::tran($this->param['title'], 'en'));
|
|
|
|
$key = trim(strtolower(preg_replace('/[\W]+/', '-', trim(Translate::tran($this->param['title'], 'en')))), '-');
|
|
|
|
$this->param['key'] = $this->getKey($key);
|
|
|
|
$rs = $this->model->add($this->param);
|
|
|
|
}
|
|
|
|
if($rs === false){
|
|
...
|
...
|
@@ -56,7 +57,7 @@ class ExtendLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function getKey($key){
|
|
|
|
$info = $this->model->read(['key'=>$key]);
|
|
|
|
if($info === false){
|
|
|
|
if($info !== false){
|
|
|
|
$key .= '_1';
|
|
|
|
return $this->getKey($key);
|
|
|
|
}
|
...
|
...
|
|