正在显示
1 个修改的文件
包含
12 行增加
和
3 行删除
| @@ -28,9 +28,18 @@ class BTemplateModuleLogic extends BaseLogic | @@ -28,9 +28,18 @@ class BTemplateModuleLogic extends BaseLogic | ||
| 28 | $map['status'] = 0; | 28 | $map['status'] = 0; |
| 29 | $list = $this->model->list($map,$order,$filed); | 29 | $list = $this->model->list($map,$order,$filed); |
| 30 | $templateLabel = new TemplateLabel(); | 30 | $templateLabel = new TemplateLabel(); |
| 31 | - foreach ($list as $k => $v){ | ||
| 32 | - $v['label'] = $templateLabel->list(['template_id'=>$v['id'],'type'=>2],'id',['id','name'],'desc'); | ||
| 33 | - $list[$k] = $v; | 31 | + $label = []; |
| 32 | + foreach ($list as $v){ | ||
| 33 | + $label[] = $v['id']; | ||
| 34 | + } | ||
| 35 | + $label_arr = $templateLabel->list(['template_id'=>['in',$label],'type'=>2],'id',['id','template_id','name'],'desc'); | ||
| 36 | + foreach ($list as $k1 => $v1){ | ||
| 37 | + foreach ($label_arr as $v2){ | ||
| 38 | + if($v2['template_id'] == $v1['id']){ | ||
| 39 | + $v1['label'] = $v2; | ||
| 40 | + $list[$k1] = $v1; | ||
| 41 | + } | ||
| 42 | + } | ||
| 34 | } | 43 | } |
| 35 | return $this->success($list); | 44 | return $this->success($list); |
| 36 | } | 45 | } |
-
请 注册 或 登录 后发表评论