Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate
正在显示
1 个修改的文件
包含
11 行增加
和
5 行删除
| @@ -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 | } |
| @@ -82,8 +85,11 @@ class TranslateLogic extends BaseLogic | @@ -82,8 +85,11 @@ class TranslateLogic extends BaseLogic | ||
| 82 | if($this->param['url'] == 'All'){ | 85 | if($this->param['url'] == 'All'){ |
| 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)){ | ||
| 86 | - $data = json_decode($info['data'],true); | 88 | + if(!empty($info) && !empty($info['data'])){ |
| 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 | } |
| @@ -227,7 +233,7 @@ class TranslateLogic extends BaseLogic | @@ -227,7 +233,7 @@ class TranslateLogic extends BaseLogic | ||
| 227 | $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); | 233 | $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'type'=>$this->param['type']]); |
| 228 | if($info === false){ | 234 | if($info === false){ |
| 229 | $param = [ | 235 | $param = [ |
| 230 | - 'type'=>1, | 236 | + 'type'=>$this->param['type'], |
| 231 | 'project_id'=>$this->user['project_id'], | 237 | 'project_id'=>$this->user['project_id'], |
| 232 | 'url'=>str_replace_url($this->param['url']), | 238 | 'url'=>str_replace_url($this->param['url']), |
| 233 | 'language_id'=>$this->param['language_id'], | 239 | 'language_id'=>$this->param['language_id'], |
-
请 注册 或 登录 后发表评论