|
@@ -99,6 +99,7 @@ class Press extends Base
|
|
|
})->order($order)->limit($this->off_set,$this->page_num)->select()->toArray();
|
|
|
foreach ($list as &$v) {
|
|
|
$v['comment_num'] = PressComment::where(['first_id'=>$v['id'],'type'=>1,'is_deleted'=>0])->count();
|
|
|
+ $v['comment_num'] = numTransform($v['comment_num']);
|
|
|
$v['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$v['id']);
|
|
|
$v['collect_num'] = UserCollect::getCollectNum(4,$v['id']);
|
|
|
$v['is_praise'] = PlatformLike::checkTags($this->user_id,$v['id'],1);
|
|
@@ -137,6 +138,8 @@ class Press extends Base
|
|
|
$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['comment_num'] = numTransform($detail['comment_num']);
|
|
|
+ $detail['transmit_num'] = numTransform($detail['transmit_num']);
|
|
|
$detail['is_collect'] = UserCollect::checkCollectByType($this->user_id,4,$detail['id']);
|
|
|
$detail['collect_num'] = UserCollect::getCollectNum(4,$detail['id']);
|
|
|
$detail['is_praise'] = PlatformLike::checkTags($this->user_id,$detail['id'],1);
|