Jump to content

Order by 2 different fields in a renderlist


piribipipi

Recommended Posts

HI... its possible to order a query by 2 different fields in a renderlist??

for example, i have module with 2 important fields called Priority and Status. I would like to order by priority DESC and status ASC... but i dont find a way to do that.... 

is that possible?????

 

thanks

Link to comment
Share on other sites

hi @NemoPs

Yes, i know how to order by two fields on mysql... but... how can i do that with a helperlist in Prestashop??

when u create an admin controller, u can specify this parameters for example:

$this->_orderBy = 'priority';

$this->_orderWay = 'DESC';

 

But... there is a way to do something like this:

 

$this->_orderBy = 'priority, status';

$this->_orderWay = 'DESC, ASC';

 

I hope u understand my idea

 

Thank u so much

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...