|
@@ -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;
|
|
@@ -271,9 +273,10 @@ class TranslateLogic extends BaseLogic |
|
@@ -271,9 +273,10 @@ class TranslateLogic extends BaseLogic |
|
271
|
}
|
273
|
}
|
|
272
|
}
|
274
|
}
|
|
273
|
}
|
275
|
}
|
|
|
|
276
|
+ $this->param['data'] = $data;
|
|
274
|
}
|
277
|
}
|
|
275
|
try {
|
278
|
try {
|
|
276
|
- $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
279
|
+ $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){
|
280
|
if($info === false){
|
|
278
|
$param = [
|
281
|
$param = [
|
|
279
|
'type'=>$this->param['type'],
|
282
|
'type'=>$this->param['type'],
|
|
@@ -285,9 +288,14 @@ class TranslateLogic extends BaseLogic |
|
@@ -285,9 +288,14 @@ class TranslateLogic extends BaseLogic |
|
285
|
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE);
|
288
|
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
286
|
$this->model->add($param);
|
289
|
$this->model->add($param);
|
|
287
|
}else{
|
290
|
}else{
|
|
288
|
- $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']]);
|
291
|
+ if(!empty($data)){
|
|
|
|
292
|
+ $data = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
|
|
293
|
+ $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']]);
|
|
|
|
294
|
+ }
|
|
290
|
}
|
295
|
}
|
|
|
|
296
|
+ //写日志
|
|
|
|
297
|
+ $userLogModel = new UserLog();
|
|
|
|
298
|
+ $userLogModel->add(['model'=>'translate/save','remark'=>json_encode($this->param,true),'type'=>0,'operator_id'=>$this->user['id'],'project_id'=>$this->user['project_id']]);
|
|
291
|
}catch (\Exception $e){
|
299
|
}catch (\Exception $e){
|
|
292
|
$this->fail('系统错误请联系管理员');
|
300
|
$this->fail('系统错误请联系管理员');
|
|
293
|
}
|
301
|
}
|