作者 lyh

gx

@@ -23,14 +23,14 @@ class BlogLabelLogic extends BaseLogic @@ -23,14 +23,14 @@ class BlogLabelLogic extends BaseLogic
23 * @author :liyuhang 23 * @author :liyuhang
24 * @method 24 * @method
25 */ 25 */
26 - public function get_label_name($v){  
27 - $label_info = $this->model->list(['id'=>['in',explode(',',trim($v['label_id'],','))]],'id',['name']); 26 + public function getLabelName($label){
  27 + $label_info = $this->model->list(['id'=>['in',explode(',',trim($label,','))]],'id',['name']);
28 $str = ''; 28 $str = '';
29 foreach ($label_info as $v1){ 29 foreach ($label_info as $v1){
30 $str .= $v1['name'].','; 30 $str .= $v1['name'].',';
31 } 31 }
32 - $v['label_name'] = trim($str,',');  
33 - return $this->success($v); 32 + $label_name = trim($str,',');
  33 + return $this->success($label_name);
34 } 34 }
35 /** 35 /**
36 * @name :新增标签 36 * @name :新增标签
@@ -150,6 +150,9 @@ class BlogLogic extends BaseLogic @@ -150,6 +150,9 @@ class BlogLogic extends BaseLogic
150 //获取所有分类 150 //获取所有分类
151 $assCateModel = new AssociationCate(); 151 $assCateModel = new AssociationCate();
152 $info['category_id'] = $assCateModel->where(['type_id'=>$info['id']])->pluck('category_id')->toArray(); 152 $info['category_id'] = $assCateModel->where(['type_id'=>$info['id']])->pluck('category_id')->toArray();
  153 + //获取标签名称
  154 + $blogLabelLogic = new BlogLabelLogic();
  155 + $info['label_name'] = $blogLabelLogic->getLabelName($info);
153 $info['image_link'] = getImageUrl($info['image']); 156 $info['image_link'] = getImageUrl($info['image']);
154 return $this->success($info); 157 return $this->success($info);
155 } 158 }