|
...
|
...
|
@@ -10,6 +10,8 @@ |
|
|
|
namespace App\Http\Logic\Bside\Setting;
|
|
|
|
|
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\Com\UpdateLog;
|
|
|
|
use App\Models\User\UserLog;
|
|
|
|
use App\Models\WebSetting\Translate as TranslateModel;
|
|
|
|
use App\Models\WebSetting\WebLanguage;
|
|
|
|
use App\Helper\Translate;
|
|
...
|
...
|
@@ -271,9 +273,10 @@ class TranslateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->param['data'] = $data;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
|
|
|
$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 = [
|
|
|
|
'type'=>$this->param['type'],
|
|
...
|
...
|
@@ -285,9 +288,14 @@ class TranslateLogic extends BaseLogic |
|
|
|
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
|
|
$this->model->add($param);
|
|
|
|
}else{
|
|
|
|
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
|
|
$this->model->edit(['data'=>$data],['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]);
|
|
|
|
if(!empty($data)){
|
|
|
|
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
|
|
|
|
$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('系统错误请联系管理员');
|
|
|
|
}
|
...
|
...
|
|