|
...
|
...
|
@@ -98,23 +98,15 @@ class BlogLogic extends BaseLogic |
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function blogInfo(){
|
|
|
|
//读取缓存
|
|
|
|
$info = Common::get_user_cache($this->model->getTable(),$this->param['id']);
|
|
|
|
if(empty($info)){
|
|
|
|
$info = $this->model->read($this->param);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
//获取分类名称
|
|
|
|
$blogCategoryLogic = new BlogCategoryLogic();
|
|
|
|
$info = $blogCategoryLogic->get_category_name($info);
|
|
|
|
//获取标签名称
|
|
|
|
$blogLabelLogic = new BlogLabelLogic();
|
|
|
|
$info['label_name'] = $blogLabelLogic->getLabelName($info['label_id']);
|
|
|
|
$info['image_link'] = getImageUrl($info['image']);
|
|
|
|
//写入缓存
|
|
|
|
Common::set_user_cache($info,$this->model->getTable(),$this->param['id']);
|
|
|
|
$info = $this->model->read($this->param);
|
|
|
|
if($info === false){
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
$info['category_id'] = explode(',',trim($info['category_id'],','));
|
|
|
|
//获取标签名称
|
|
|
|
$blogLabelLogic = new BlogLabelLogic();
|
|
|
|
$info['label_name'] = $blogLabelLogic->getLabelName($info['label_id']);
|
|
|
|
$info['image_link'] = getImageUrl($info['image']);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|