正在显示
1 个修改的文件
包含
14 行增加
和
5 行删除
| @@ -33,13 +33,22 @@ class BTemplateModuleProjectLogic extends BaseLogic | @@ -33,13 +33,22 @@ class BTemplateModuleProjectLogic extends BaseLogic | ||
| 33 | public function ModuleList($map,$order = 'created_at',$filed = ['id','name','status','image','html','project_id']){ | 33 | public function ModuleList($map,$order = 'created_at',$filed = ['id','name','status','image','html','project_id']){ |
| 34 | $map['deleted_status'] = 0; | 34 | $map['deleted_status'] = 0; |
| 35 | $map['project_id'] = $this->user['project_id']; | 35 | $map['project_id'] = $this->user['project_id']; |
| 36 | - $lists = $this->model->list($map,$order,$filed); | 36 | + $list = $this->model->list($map,$order,$filed); |
| 37 | $templateLabel = new TemplateLabel(); | 37 | $templateLabel = new TemplateLabel(); |
| 38 | - foreach ($lists as $k => $v){ | ||
| 39 | - $v['label'] = $templateLabel->list(['template_id'=>$v['id'],'type'=>2],'id',['id','name'],'desc'); | ||
| 40 | - $lists[$k] = $v; | 38 | + $label = []; |
| 39 | + foreach ($list as $v){ | ||
| 40 | + $label[] = $v['id']; | ||
| 41 | } | 41 | } |
| 42 | - return $this->success($lists); | 42 | + $label_arr = $templateLabel->list(['template_id'=>['in',$label],'type'=>2],'id',['id','template_id','name'],'desc'); |
| 43 | + foreach ($list as $k1 => $v1){ | ||
| 44 | + foreach ($label_arr as $v2){ | ||
| 45 | + if($v2['template_id'] == $v1['id']){ | ||
| 46 | + $v1['label'] = $v2; | ||
| 47 | + $list[$k1] = $v1; | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | + } | ||
| 51 | + return $this->success($list); | ||
| 43 | } | 52 | } |
| 44 | 53 | ||
| 45 | /** | 54 | /** |
-
请 注册 或 登录 后发表评论