作者 lyh

gx暂停优化项目

@@ -290,8 +290,8 @@ class TranslateLogic extends BaseLogic @@ -290,8 +290,8 @@ class TranslateLogic extends BaseLogic
290 } 290 }
291 DB::beginTransaction(); 291 DB::beginTransaction();
292 try { 292 try {
293 - $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);  
294 $sourceInfo = $this->getRouteSource($sendData['new_route']); 293 $sourceInfo = $this->getRouteSource($sendData['new_route']);
  294 + $info = $this->model->read(['language_id'=>$this->param['language_id'],'source_id'=>$sourceInfo['source_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
295 if($info === false){ 295 if($info === false){
296 $param = [ 296 $param = [
297 'type'=>$this->param['type'] ?? 1, 297 'type'=>$this->param['type'] ?? 1,
@@ -308,7 +308,7 @@ class TranslateLogic extends BaseLogic @@ -308,7 +308,7 @@ class TranslateLogic extends BaseLogic
308 $id = $this->model->addReturnId($param); 308 $id = $this->model->addReturnId($param);
309 TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]); 309 TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
310 }else{ 310 }else{
311 - TranslateData::where(['trans_id'=>$info['id']])->update(['source_id'=>$sourceInfo['source_id'],'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]); 311 + TranslateData::where(['trans_id'=>$info['id']])->update(['data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
312 } 312 }
313 //写日志 313 //写日志
314 $userLogModel = new UserLog(); 314 $userLogModel = new UserLog();