有序的数组 根据key的值相同分组
{"resultCode":"00","resultDesc":"成功","resultObj":[{"moneyId":"440","targetType":"0","targetId":"868","userId":"57","dataId":"","dataSrc":"3","moneyRemark":"【订单结算】134915181562123108","moneyType":"2","money":"0.90","createTime":"2018-02-09 14:03:45","transactionId":"48288341518156225","payType":"0","dataFlag":"1"},{"moneyId":"417","targetType":"0","targetId":"57","userId":"57","dataId":"","dataSrc":"3","moneyRemark":"【押金充值】","moneyType":"4","money":"799.00","createTime":"2018-02-07 13:45:09","transactionId":"66092741517982309","payType":"0","dataFlag":"1"},{"moneyId":"392","targetType":"0","targetId":"787","userId":"57","dataId":"","dataSrc":"3","moneyRemark":"【订单结算】573315178258689321","moneyType":"2","money":"0.01","createTime":"2018-02-05 18:17:53","transactionId":"32945681517825873","payType":"0","dataFlag":"1"},{"moneyId":"386","targetType":"0","targetId":"775","userId":"57","dataId":"","dataSrc":"","moneyRemark":"【订单结算】518615178167452473","moneyType":"2","money":"0.01","createTime":"2018-02-05 15:45:53","transactionId":"26542031517816753","payType":"0","dataFlag":"1"},{"moneyId":"197","targetType":"0","targetId":"574","userId":"57","dataId":"","dataSrc":"","moneyRemark":"【订单结算】730415175577236220","moneyType":"2","money":"260.00","createTime":"2018-02-02 15:48:48","transactionId":"21795661517557728","payType":"0","dataFlag":"1"},{"moneyId":"196","targetType":"0","targetId":"57","userId":"57","dataId":"","dataSrc":"","moneyRemark":"【押金充值】","moneyType":"4","money":"799.00","createTime":"2018-02-02 15:48:31","transactionId":"55511471517557711","payType":"0","dataFlag":"1"},{"moneyId":"188","targetType":"0","targetId":"527","userId":"57","dataId":"","dataSrc":"","moneyRemark":"【订单结算】890615174702859384","moneyType":"2","money":"786.00","createTime":"2018-02-01 15:31:55","transactionId":"73696901517470315","payType":"0","dataFlag":"1"},{"moneyId":"187","targetType":"0","targetId":"526","userId":"57","dataId":"","dataSrc":"","moneyRemark":"【订单结算】517115174701456833","moneyType":"2","money":"1230.00","createTime":"2018-02-01 15:29:15","transactionId":"16311651517470155","payType":"0","dataFlag":"1"},{"moneyId":"186","targetType":"0","targetId":"57","userId":"57","dataId":"","dataSrc":"","moneyRemark":"【押金充值】","moneyType":"4","money":"799.00","createTime":"2018-02-01 15:26:00","transactionId":"13928231517469960","payType":"0","dataFlag":"1"}]}
数据模版根据时间日期来分组的
思路分析 就是选取出第一个做比较的值 然后进行比较 当比较不同时先存起来 然后再初始化数组, 改变比较直 再进行比较(前提是有序的我的例子是根据时间来做比较的)时间是倒叙的
网友评论