作者 lyh

gx

@@ -10,6 +10,8 @@ @@ -10,6 +10,8 @@
10 namespace App\Http\Logic\Bside\Setting; 10 namespace App\Http\Logic\Bside\Setting;
11 11
12 use App\Http\Logic\Bside\BaseLogic; 12 use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\Com\UpdateLog;
  14 +use App\Models\User\UserLog;
13 use App\Models\WebSetting\Translate as TranslateModel; 15 use App\Models\WebSetting\Translate as TranslateModel;
14 use App\Models\WebSetting\WebLanguage; 16 use App\Models\WebSetting\WebLanguage;
15 use App\Helper\Translate; 17 use App\Helper\Translate;
@@ -273,7 +275,7 @@ class TranslateLogic extends BaseLogic @@ -273,7 +275,7 @@ class TranslateLogic extends BaseLogic
273 } 275 }
274 } 276 }
275 try { 277 try {
276 - $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); 278 + $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
277 if($info === false){ 279 if($info === false){
278 $param = [ 280 $param = [
279 'type'=>$this->param['type'], 281 'type'=>$this->param['type'],
@@ -285,9 +287,14 @@ class TranslateLogic extends BaseLogic @@ -285,9 +287,14 @@ class TranslateLogic extends BaseLogic
285 $param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE); 287 $param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE);
286 $this->model->add($param); 288 $this->model->add($param);
287 }else{ 289 }else{
  290 + if(!empty($data)){
288 $data = json_encode($data,JSON_UNESCAPED_UNICODE); 291 $data = json_encode($data,JSON_UNESCAPED_UNICODE);
289 - $this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); 292 + $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']]);
290 } 293 }
  294 + }
  295 + //写日志
  296 + $userLogModel = new UserLog();
  297 + $userLogModel->add(['model'=>'translate/save','remark'=>$data,'type'=>0,'user_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]);
291 }catch (\Exception $e){ 298 }catch (\Exception $e){
292 $this->fail('系统错误请联系管理员'); 299 $this->fail('系统错误请联系管理员');
293 } 300 }