$aid = input('id');
$id = id_decrypt($aid);
// $where1 = 'is_pass = 1 and (pet_id = '.$this->chongwu_id.' or (classid = '.$this->chongwu_classid.' and pet_cate_id = 1))';
$where1 = 'is_pass = 1 and (pet_id = '.$this->chongwu_id.')';
if (isset($aid) && is_numeric($aid) && $aid >0) {
$info = model('article')->where($where1)->where('id',$aid)->find();
} else {
$info = model('article')->where($where1)->where('id', $id)->find();
}
$assign['doctorxx'] = db('doctor')->field(['title', 'id', 'picurl', 'zhichen', 'address','shanchang'])->where('id', $info['doctorid'])->select();
//获得前20篇和后20遍文章
$where_prev = 'id < '.$info['id'];
$prev20 = model('article')->field('id,title')->where($where1)->where($where_prev)->limit(20)->order('id desc')->select()->toArray();
foreach ($prev20 as &$vvv){
$vvv['seo_url'] = seo_url('wz/detail',$vvv['id'], '/');
}
$where_next = 'id > '.$info['id'];
$next20 = model('article')->field('id,title,pet_id')->where($where1)->where($where_next)->limit(20)->order('id asc')->select()->toArray();