Yes, you are doing it wrong.
Static methods are easy to call but have several architectural drawbacks, so generally speaking they should be used sparingly (or, even better: avoided altogether).
In this instance there is no reason to use a static method and especially one that writes custom SQL. Use Yii's named scopes to accomplish the same goal:
class Post extends CActiveRecord
{
public function scopes()
{
return array(
'trashed'=>array(
'condition' => "publish_status = 'trash'",
),
);
}
}
And then:
$trashedCount = Post::model()->trashed()->count();