|
@@ -23,13 +23,12 @@ class BlogLabelLogic extends BaseLogic |
|
@@ -23,13 +23,12 @@ class BlogLabelLogic extends BaseLogic |
|
23
|
* @author :liyuhang
|
23
|
* @author :liyuhang
|
|
24
|
* @method
|
24
|
* @method
|
|
25
|
*/
|
25
|
*/
|
|
26
|
- public function getLabelName($label){
|
|
|
|
27
|
- $label_info = $this->model->list(['id'=>['in',explode(',',trim($label,','))]],'id',['name']);
|
|
|
|
28
|
- $str = '';
|
|
|
|
29
|
- foreach ($label_info as $v1){
|
|
|
|
30
|
- $str .= $v1['name'].',';
|
26
|
+ public function getLabelName($label_id){
|
|
|
|
27
|
+ $label_name = '';
|
|
|
|
28
|
+ if(!empty($label_id)){
|
|
|
|
29
|
+ $label_arr = $this->model->formatQuery(['id'=>['in',explode(',',trim($label_id,','))]])->pluck('name')->toArray();
|
|
|
|
30
|
+ $label_name = explode(',',$label_arr);
|
|
31
|
}
|
31
|
}
|
|
32
|
- $label_name = trim($str,',');
|
|
|
|
33
|
return $this->success($label_name);
|
32
|
return $this->success($label_name);
|
|
34
|
}
|
33
|
}
|
|
35
|
/**
|
34
|
/**
|