|
@@ -133,7 +133,8 @@ class Press extends Base
|
|
|
public function getPressDetail()
|
|
|
{
|
|
|
$sel_where[] = ['id','=',input('get.id')];
|
|
|
- $detail = \app\common\model\Press::field('id,images,title,content,read_num,create_at,transmit_num,user_id')->where($sel_where)->find()->toArray();
|
|
|
+ $detail = \app\common\model\Press::field('id,images,title,content,read_num,create_at,transmit_num,user_id,is_deleted,status')->where($sel_where)->find()->toArray();
|
|
|
+ if($detail['is_deleted'] == 1 || $detail['status'] == 0) $this->error('该新闻已下架');
|
|
|
$detail['comment_num'] = PressComment::where(['first_id'=>$detail['id'],'type'=>1,'is_deleted'=>0])->count();
|
|
|
$detail['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$detail['id']);
|
|
|
$detail['collect_num'] = UserCollect::getCollectNum(4,$detail['id']);
|