{"Code":"0","Result":{"Orders":{"171865304":{"LastId":30351,"Time":"2017-06-28T14:56:28+08:00","OrderId":171865304,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-18T00:00:00+08:00","DepartureDate":"2017-07-19T00:00:00+08:00","TotalPrice":8,"NumberOfRooms":1,"AffiliateConfirmationId":"1326","OriginStatus":"D"},"171865316":{"LastId":30360,"Time":"2017-06-28T15:02:20+08:00","OrderId":171865316,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-18T00:00:00+08:00","DepartureDate":"2017-07-19T00:00:00+08:00","TotalPrice":8,"NumberOfRooms":1,"AffiliateConfirmationId":"1327","OriginStatus":"D"},"171865325":{"LastId":30361,"Time":"2017-06-28T15:05:05+08:00","OrderId":171865325,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-18T00:00:00+08:00","DepartureDate":"2017-07-19T00:00:00+08:00","TotalPrice":8,"NumberOfRooms":1,"AffiliateConfirmationId":"1328","OriginStatus":"D"},"171865326":{"LastId":30362,"Time":"2017-06-28T15:05:59+08:00","OrderId":171865326,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-18T00:00:00+08:00","DepartureDate":"2017-07-19T00:00:00+08:00","TotalPrice":8,"NumberOfRooms":1,"AffiliateConfirmationId":"1329","OriginStatus":"D"},"171865327":{"LastId":30363,"Time":"2017-06-28T15:11:32+08:00","OrderId":171865327,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-18T00:00:00+08:00","DepartureDate":"2017-07-19T00:00:00+08:00","TotalPrice":8,"NumberOfRooms":1,"AffiliateConfirmationId":"1330","OriginStatus":"D"},"171865294":{"LastId":30378,"Time":"2017-06-28T15:37:05+08:00","OrderId":171865294,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-06-28T00:00:00+08:00","DepartureDate":"2017-06-29T00:00:00+08:00","TotalPrice":70,"NumberOfRooms":1,"AffiliateConfirmationId":"314243799193660","OriginStatus":"D"},"171865125":{"LastId":30440,"Time":"2017-06-28T16:57:08+08:00","OrderId":171865125,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-06T00:00:00+08:00","DepartureDate":"2017-07-07T00:00:00+08:00","TotalPrice":601,"NumberOfRooms":1,"AffiliateConfirmationId":"H170627110452902933","OriginStatus":"D"},"171865382":{"LastId":30485,"Time":"2017-06-28T18:26:32+08:00","OrderId":171865382,"Status":-6,"PayStatus":-1,"ArrivalDate":"2017-07-18T00:00:00+08:00","DepartureDate":"2017-07-19T00:00:00+08:00","TotalPrice":8,"NumberOfRooms":1,"AffiliateConfirmationId":"1331","OriginStatus":"D"}}},"Guid":"afcbafd4-0831-43bf-8daf-6a605f0fcc05"}
Das Obige sind die Rohdaten von JSON.
Ich habe es mit Postman angefordert und dann festgestellt, dass sich die Reihenfolge des Arrays nach der Formatierung geändert hat, weil ich mit einem Array-Sortierproblem zu tun hatte. Ich habe den Code lange überprüft und festgestellt, dass es kein Problem gab, aber dann Ich habe festgestellt, dass ein Formatierungsfehler vorliegt. Darf ich fragen, was der Grund dafür sein könnte?
Das Folgende ist ein formatierter Screenshot. Offensichtlich ist der erste Wert im Quellcode 171865304
因为你这是一个对象,对象里都是键值对,顺序是随机的。具体的顺序如何是浏览器自己决定的。如果想要有序,建议将此类对象变为如下格式数组:
因为你的Orders是个对象,不是个数组啊