
Jason
Staff
/ Moderator

Nov 14, 2011, 8:51 PM
Post #2 of 2
(199 views)
Shortcut
|
|
Re: [rjbathgate] orderBy value in related table
[In reply to]
|
Can't Post
|
|
Hi, Yes, you can do this by using the leftJoin option in getRecords. For example:
list($productsRecords, $productsMetaData) = getRecords(array( 'tableName' => 'products', 'allowSearch' => false, 'leftJoin' => array('categories' => 'category'), 'orderBy' => 'categories.featured DESC', )); This returns the records in "products" sorted so that the products with a category where the featured checkbox is checked appear first. Hope this helps --------------------------------------------------- Jason Sauchuk - Programmer interactivetools.com Hire me! Save time by getting our experts to help with your project. http://www.interactivetools.com/consulting/
|