Pagination count with relational rows

I try to get the count from Table ‘User’ within the joined table AuthAssignment.

Without the Joined Table AuthAssignment I get 9 rows, but with it there are all together 26 rows.

But I can’t get the count of 26 in the pagination where the result is never more than 9.

How can I get it working, the count() counts the joined Items?

And next it should work with seach criteria within both Tables.

I hope, that’s not to much for Yii.

Here the simple pagination Code.

_addSearchConditions() adds addSearchCondition() to $ct.

private function _getUserList()


$ct=new CDbCriteria(array(



	'order'=>'t.username ASC',





$this->paginate=new CPagination($count);

// results per page




return $this->users;


private function _addSearchConditions($criteria)













	foreach($fields as $table => $columns)


		foreach($columns as $k => $v)


			if($this->searchFields[$k] != $this->defaultSearchFields[$k])

				$criteria->addSearchCondition("$table.$v", $this->searchFields[$k], true, 'AND', 'LIKE');



	return $criteria;


I can’t get this working.

The Column User comes from Table User.

The Columns Roles, BizRule and Data are coming from Table AuthAssignments.

The inputfields above are Searchfields.

And it seems to be impossible, to get the matching Itemcont.

Can anybody help me?