|
...
|
...
|
@@ -251,7 +251,7 @@ class TranslateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$this->param['data'] = $data;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
|
|
|
|
if($info === false){
|
|
|
|
$param = [
|
|
...
|
...
|
@@ -262,21 +262,21 @@ class TranslateLogic extends BaseLogic |
|
|
|
'alias'=>$this->param['alias'],
|
|
|
|
];
|
|
|
|
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
|
|
$this->model->add($param);
|
|
|
|
$rs = $this->model->add($param);
|
|
|
|
}else{
|
|
|
|
if(!empty($data)){
|
|
|
|
$data = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
|
|
$this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'project_id'=>$this->user['project_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
|
|
|
$rs = $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'project_id'=>$this->user['project_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//写日志
|
|
|
|
$userLogModel = new UserLog();
|
|
|
|
$userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]);
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('系统错误请联系管理员');
|
|
|
|
}
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// $this->fail('系统错误请联系管理员');
|
|
|
|
// }
|
|
|
|
$this->handleRoute($this->param['url']);
|
|
|
|
return $this->success();
|
|
|
|
return $this->success($rs);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|