$get = request()->route();
$field = (new Article)->where($get)->find();
$artTags = (new TagOptionModel)->field('tag_id')->where('post_id',$field['id'])->select()->toArray();
$arr = array();
foreach($artTags as $a){
$arr[] = $a['tag_id'];
}
$tag_ids = implode(',', $arr);
$tagAll = (new TagModel)->field('id,name')->where(['id' => ['in',$tag_ids]])->select()->toArray();
$field->tagsAll = $tagAll;
(new Article)->where('url',$get['url'])->update(array('view'=>$field['view']+1));
$field_cate = (new Category)->where('id',$field['cate_id'])->find();
//热门标签
$randTags = (new TagModel)->order('view desc')->limit(50)->select();
$this->assign('randTags',$randTags);
//相关文章
$likewhere['title'] = ['like','%'.mb_substr($field['title'],0,3).'%'];
$randArt = (new Article)->where($likewhere)->order('view desc')->limit(5)->select()->toArray();
$this->assign('randarr',$randArt);