Hi everyone,
How can I do ORDER BY supplier_value DESC, supplier_quantity ASC using order_by_metadata, where supplier_value and supplier_quantity are metadata name of my entity.
I used to do like this with one metadata name. How to add supplier_value in order by
'order_by_metadata' => [
'name' => 'supplier_value',
'direction' => 'DESC',
'as' => 'integer'
]
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Jerome Bakker@jeabakker
Jerome Bakker - 1 like
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 1 like
- Hermand Pessek@rheman
Hermand Pessek - 0 likes
You must log in to post replies.You can't use `order_by_metadata` with more than 1 field. If you wish to order by more fields use `$options['order_by']`, this can accept an array of order fields (make sure they are in the select)
Look at this.
Thanks a lot