|
...
|
...
|
@@ -28,9 +28,18 @@ class BTemplateModuleLogic extends BaseLogic |
|
|
|
$map['status'] = 0;
|
|
|
|
$list = $this->model->list($map,$order,$filed);
|
|
|
|
$templateLabel = new TemplateLabel();
|
|
|
|
foreach ($list as $k => $v){
|
|
|
|
$v['label'] = $templateLabel->list(['template_id'=>$v['id'],'type'=>2],'id',['id','name'],'desc');
|
|
|
|
$list[$k] = $v;
|
|
|
|
$label = [];
|
|
|
|
foreach ($list as $v){
|
|
|
|
$label[] = $v['id'];
|
|
|
|
}
|
|
|
|
$label_arr = $templateLabel->list(['template_id'=>['in',$label],'type'=>2],'id',['id','template_id','name'],'desc');
|
|
|
|
foreach ($list as $k1 => $v1){
|
|
|
|
foreach ($label_arr as $v2){
|
|
|
|
if($v2['template_id'] == $v1['id']){
|
|
|
|
$v1['label'] = $v2;
|
|
|
|
$list[$k1] = $v1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($list);
|
|
|
|
}
|
...
|
...
|
|