How can I implement a
ORDER BY sort1 DESC, sort2 DESC
logic in an JSON array like such:
var items = '[
{
"sort1": 1,
"sort2": 3,
"name" : "a",
},
{
"sort1": 1,
"sort2": 2,
"name" : "b",
},
{
"sort1": 2,
"sort2": 1,
"name" : "c",
}
]';
resulting in the new order :
b,a,c
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…