$model=Post::model()->findByAttributes(array('user'=>$user));这个方法是 只要找到一个符合的 就返回 ,findAllByAttributes 找全部 的 数据 , 用法一样的