Possibly a 'sortby' error?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 29, 2011   (RSS)

Re: [Wolf-E] Possibly a 'sortby' error?

By Jason - July 22, 2011

Hi,

How are you storing a category for price movers? Since the only difference between the two queries is how you're sorting the records, is is entirely possible that the same record would appear in both columns.

A good way to address this would be to add a check box called "price_mover" and check this for records you want to appear in the price movers column but not the new properties column. You can then structure your queries like this:

// load latest movers records
list($moverspropertyRecords, $moverspropertyMetaData) = getRecords(array(
'tableName' => 'property',
'perPage' => '6',
'orderBy' => 'updatedDate DESC, new_price',
'where' => "price_movers = 1",
'allowSearch' => '0',
));


// load records
list($propertyRecords, $propertyMetaData) = getRecords(array(
'tableName' => 'property',
'perPage' => '6',
'orderBy' => 'date DESC',
'where' => "price_movers = 0",
'allowSearch' => '0',
));


Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Possibly a 'sortby' error?

By Wolf-E - July 29, 2011

Thanks Jason.

That worked well and the sort now looks a lot tidier. Appreciate the advice.

Cheers ~ Wolf-E

[:)]