$bagecmsShow = Post::model()->findByPk( intval( $id ) );
$bagecmsShow->updateCounters(array ('view_count' => 1 ), 'id=:id', array ('id' => $id ));
视图里即可用:
<?php echo $bagecmsShow->view_count?>