这家伙有点懒,还没写个性签名!
echo $query->createCommand()->sql;
public function actionView($id) { $post = Post::model()->findByPk($id); $post->visits += 1;$post->save(); $this->render('view', array('post' => $post)); }