作者 lyh

gx

... ... @@ -56,6 +56,7 @@ class TranslateLogic extends BaseLogic
$old_key = [];//key值组成数据
if($info !== false){
$data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data_read, true) . PHP_EOL, FILE_APPEND);
foreach ($data_read as $k => $v){
$old_key[] = $k;
$data[] = [$k => $v];
... ... @@ -261,13 +262,11 @@ class TranslateLogic extends BaseLogic
'language_id'=>$this->param['language_id'],
'alias'=>$this->param['alias'],
];
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE);
$param['data'] = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$rs = $this->model->add($param);
}else{
if(!empty($data)){
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
$data = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$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']]);
}
}
... ...