作者 lyh

gx

... ... @@ -23,14 +23,14 @@ class BlogLabelLogic extends BaseLogic
* @author :liyuhang
* @method
*/
public function get_label_name($v){
$label_info = $this->model->list(['id'=>['in',explode(',',trim($v['label_id'],','))]],'id',['name']);
public function getLabelName($label){
$label_info = $this->model->list(['id'=>['in',explode(',',trim($label,','))]],'id',['name']);
$str = '';
foreach ($label_info as $v1){
$str .= $v1['name'].',';
}
$v['label_name'] = trim($str,',');
return $this->success($v);
$label_name = trim($str,',');
return $this->success($label_name);
}
/**
* @name :新增标签
... ...
... ... @@ -150,6 +150,9 @@ class BlogLogic extends BaseLogic
//获取所有分类
$assCateModel = new AssociationCate();
$info['category_id'] = $assCateModel->where(['type_id'=>$info['id']])->pluck('category_id')->toArray();
//获取标签名称
$blogLabelLogic = new BlogLabelLogic();
$info['label_name'] = $blogLabelLogic->getLabelName($info);
$info['image_link'] = getImageUrl($info['image']);
return $this->success($info);
}
... ...