Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Ordering Cactivedataprovider From Second Join

$
0
0
Hi

I have the following code:

	public function actionIndex($id) 
	{
		
		$dataProvider=new CActiveDataProvider('Item', array(
			'criteria' => array(
			'with' =>'Area',
			'condition' => 't.Area_id=:id',
			'params' => array(':id'=>$id),


What I need to do is join another table of featured Items and then order the whole thing with by what results are featured?

So far I got to this:

	public function actionIndex($id) 
	{
		
		$dataProvider=new CActiveDataProvider('Item', array(
			'criteria' => array(
			'with' =>'Area',
			'condition' => 't.Area_id=:id',
			'params' => array(':id'=>$id),
                        'with' =>'featuredItems',




But then I just keep inuring errors if I try to order the results. I'm not sure how to use the Item.id to join the featuredItems.item_id as a condition? Or if that column data would even be available during this point in the query

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>