作者 lyh

gx

... ... @@ -55,14 +55,12 @@ class TranslateLogic extends BaseLogic
// 原始校对程序
$old_key = [];//key值组成数据
if($info !== false){
$data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE);
$data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
foreach ($data_read as $k => $v){
$old_key[] = $k;
$data[] = [$k => $v];
}
}
$json_text = json_encode($text_array,JSON_UNESCAPED_UNICODE);
$text_array = json_decode($json_text,JSON_UNESCAPED_UNICODE);
$arr2 = array_values(array_diff($text_array, $old_key));
if(!empty($arr2)){
$i = 0;
... ... @@ -125,7 +123,7 @@ class TranslateLogic extends BaseLogic
}
$new_list = $this->getUrlImageRead($url);
$old_list = [];
$data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE);
$data_read = json_decode($info['data'],JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
foreach ($data_read as $k=>$v){
$old_list[] = $k;
$data[] = [
... ... @@ -257,11 +255,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);
$this->model->add($param);
}else{
if(!empty($data)){
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
$data = json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
$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']]);
}
}
... ...