作者 lyh

gx

@@ -34,8 +34,11 @@ class TranslateLogic extends BaseLogic @@ -34,8 +34,11 @@ class TranslateLogic extends BaseLogic
34 if($this->param['url'] == 'All'){ 34 if($this->param['url'] == 'All'){
35 $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); 35 $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]);
36 $data = []; 36 $data = [];
37 - if(!empty($info)){  
38 - $data = json_decode($info['data'],true); 37 + if(!empty($info) && !empty($info['data'])){
  38 + $translateInfo = json_decode($info['data'],true);
  39 + foreach ($translateInfo as $k => $v){
  40 + $data[] = [$k=>$v];
  41 + }
39 } 42 }
40 return $this->success($data); 43 return $this->success($data);
41 } 44 }
@@ -83,7 +86,10 @@ class TranslateLogic extends BaseLogic @@ -83,7 +86,10 @@ class TranslateLogic extends BaseLogic
83 $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]); 86 $info = $this->model->read(['url'=>$this->param['url'],'language_id'=>$this->param['language_id'],'type'=>$this->param['type']]);
84 $data = []; 87 $data = [];
85 if(!empty($info) && !empty($info['data'])){ 88 if(!empty($info) && !empty($info['data'])){
86 - $data = json_decode($info['data'],true); 89 + $translateInfo = json_decode($info['data'],true);
  90 + foreach ($translateInfo as $k => $v){
  91 + $data[] = [$k=>$v];
  92 + }
87 } 93 }
88 return $this->success($data); 94 return $this->success($data);
89 } 95 }