Created
September 2, 2011 17:56
Revisions
-
intel352 revised this gist
Sep 2, 2011 . 1 changed file with 32 additions and 32 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,34 +1,34 @@ <?php $ordersForShipping=new CActiveDataProvider( Orders::model()->with(array( 'cart'=>array( /* * Ensure occurs in same query */ 'together'=>true, 'joinType'=>'INNER JOIN', 'with'=>array( 'items'=>array( /* * Ensure they exist without selecting data */ 'select'=>false, 'together'=>true, 'joinType'=>'INNER JOIN', 'with'=>array( 'shipment'=>array( 'select'=>false, 'together'=>true, 'joinType'=>'LEFT JOIN', /* * Important: This condition must exist in WHERE statement, not JOIN * I think it works here, but needs to be tested with Yii generated query displayed * Also, the alias in the condition may need correcting */ 'condition'=>'shipment.id IS NULL' ), ) ), ) ), ))); -
intel352 revised this gist
Sep 2, 2011 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ <?php $ordersForShipping=Orders::model()->with(array( 'cart'=>array( /* -
intel352 renamed this gist
Sep 2, 2011 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,6 @@ $ordersForShipping=Orders::model()->with(array( */ 'together'=>true, 'joinType'=>'INNER JOIN', 'with'=>array( 'items'=>array( /* -
acodesmith created this gist
Sep 2, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ $ordersForShipping=Orders::model()->with(array( 'cart'=>array( /* * Ensure occurs in same query */ 'together'=>true, 'joinType'=>'INNER JOIN', //'select'=>false, //'condition'=>'posts.published=1', 'with'=>array( 'items'=>array( /* * Ensure they exist without selecting data */ 'select'=>false, 'together'=>true, 'joinType'=>'INNER JOIN', 'with'=>array( 'shipment'=>array( 'select'=>false, 'together'=>true, 'joinType'=>'LEFT JOIN', /* * Important: This condition must exist in WHERE statement, not JOIN * I think it works here, but needs to be tested with Yii generated query displayed * Also, the alias in the condition may need correcting */ 'condition'=>'shipment.id IS NULL' ), ) ), ) ), ))->findAll();