|
...
|
...
|
@@ -42,12 +42,12 @@ class TemplateLabelLogic extends BaseLogic |
|
|
|
public function saveLabel(){
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$id = $this->param['id'];
|
|
|
|
$info = $this->model->read(['name'=>$this->param['name'],['template_id'=>$this->param['template_id']],'id'=>['!=',$id]],['id']);
|
|
|
|
$info = $this->model->read(['name'=>$this->param['name'],'template_id'=>$this->param['template_id'],'id'=>['!=',$id]],['id']);
|
|
|
|
if($info === false){
|
|
|
|
$this->model->edit($this->param,['id'=>$id]);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$info = $this->model->read(['name'=>$this->param['name'],['template_id'=>$this->param['template_id']]],['id']);
|
|
|
|
$info = $this->model->read(['name'=>$this->param['name'],'template_id'=>$this->param['template_id']],['id']);
|
|
|
|
if($info === false){
|
|
|
|
$this->param['manager_id'] = $this->manager['id'];
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
...
|
...
|
|