Last active
October 10, 2017 07:23
-
-
Save orangerdev/505134936b967991de9aac25459b0915 to your computer and use it in GitHub Desktop.
TASK 1 - Ordering companies by sponsored and ranking
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 characters
$args = [ | |
'post_type' => 'company', | |
'posts_per_page' => 100, | |
'meta_query' => [ | |
'relation' => 'AND', | |
[ | |
'key' => 'sponsored', | |
'value' => [0,1] | |
'compare' => 'IN' | |
], | |
[ | |
'key' => 'ranking', | |
'value' => [0,100], | |
'compare' => 'BETWEEN', | |
'type' => 'DECIMAL(4,1)' | |
] | |
], | |
'orderby' => [ | |
'sponsored' => 'DESC', | |
'ranking' => 'DESC' | |
] | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment