作者 lyh

gx

@@ -52,15 +52,9 @@ class TranslateLogic extends BaseLogic @@ -52,15 +52,9 @@ class TranslateLogic extends BaseLogic
52 $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); 52 $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]);
53 //获取当前URl的所有文本内容 53 //获取当前URl的所有文本内容
54 $text_array = $this->getUrlRead($url); 54 $text_array = $this->getUrlRead($url);
55 - if($this->user['project_id'] == 655){  
56 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($text_array, true) . PHP_EOL, FILE_APPEND);  
57 - }  
58 // 原始校对程序 55 // 原始校对程序
59 $old_key = [];//key值组成数据 56 $old_key = [];//key值组成数据
60 $data_read = json_decode($info ? $info['data'] : '',JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); 57 $data_read = json_decode($info ? $info['data'] : '',JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
61 - if($this->user['project_id'] == 655){  
62 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data_read, true) . PHP_EOL, FILE_APPEND);  
63 - }  
64 if(!empty($data_read)){ 58 if(!empty($data_read)){
65 foreach ($data_read as $k => $v){ 59 foreach ($data_read as $k => $v){
66 $k = urldecode($k); 60 $k = urldecode($k);
@@ -70,7 +64,10 @@ class TranslateLogic extends BaseLogic @@ -70,7 +64,10 @@ class TranslateLogic extends BaseLogic
70 } 64 }
71 $arr2 = []; 65 $arr2 = [];
72 foreach ($text_array as $val) { 66 foreach ($text_array as $val) {
73 - if (FALSE == in_array($val, $old_key)){ 67 + if($val == ' '){
  68 + continue;
  69 + }
  70 + if (FALSE == in_array(trim(urldecode($val),' '), $old_key)){
74 $arr2[] = $val; 71 $arr2[] = $val;
75 } 72 }
76 } 73 }