我需要您在此方面的專業知識。如何爲http.get請求數據創建總計
我通過http.get請求獲取數據和JSON數據是像如下:
{"displayTransactionDateTime": "Tue, 19th Sep 2017"
, "transactionDateAndTime": "2017-09-19 18:36:34.0"
, "transactionId": "158131"
, "refTransactionId": null
, "transactionType": "Credit Transfer"
, "creditType": "Transfer"
, "transactionMode": "SYSTEM CREDITS"
, "transactionCurrency": "SYSTEM CREDITS"
, "transactionAmount": "50"
, "credits": "50"
, "creditMessage": ""},
{"displayTransactionDateTime": "Wed, 13th Sep 2017"
, "transactionDateAndTime": "2017-09-13 09:53:28.0"
, "transactionId": "157687"
, "refTransactionId": null
, "transactionType": "Credit Purchase"
, "creditType": "Bought"
, "transactionMode": "CREDIT CARD"
, "transactionCurrency": "AED"
, "transactionAmount": "50"
, "credits": "10"
, "creditMessage": null},
{"displayTransactionDateTime": "Sat, 9th Sep 2017"
, "transactionDateAndTime": "2017-09-09 14:49:42.0"
, "transactionId": "157378"
, "refTransactionId": null
, "transactionType": "Voucher Purchase"
, "creditType": "Spent"
, "transactionMode": "SYSTEM CREDITS"
, "transactionCurrency": "SYSTEM CREDITS"
, "transactionAmount": "5"
, "credits": "5"
, "creditMessage": null}
{
"displayTransactionDateTime": "Tue, 7th Feb 2017"
, "transactionDateAndTime": "2017-02-07 19:11:40.0"
, "transactionId": "34133"
, "refTransactionId": "34132"
, "transactionType": "Credit Award"
, "creditType": "Award"
, "transactionMode": "SYSTEM CREDITS"
, "transactionCurrency": "SYSTEM CREDITS"
, "transactionAmount": "1"
, "credits": "1"
, "creditMessage": "Referral Credit Award"}
{"displayTransactionDateTime": "Sat, 20th Aug 2016"
, "transactionDateAndTime": "2016-08-20 17:50:42.0"
, "transactionId": "10348"
, "refTransactionId": "10347"
, "transactionType": "Credit Received"
, "creditType": "Recieved"
, "transactionMode": "SYSTEM CREDITS"
, "transactionCurrency": "SYSTEM CREDITS"
, "transactionAmount": "1"
, "credits": "1"
, "creditMessage": ""}
在總的I有100條記錄包含有這些5個creditTypes混合。
"creditType": "Transfer", "creditType": "Bought", "creditType": "Spent",
"creditType": "Award", "creditType": "Received".
並且還有每個creditType的積分。
爲了看到我用ng-repeat顯示數據的錯誤,但它工作的很完美。
任何人都可以幫助我如何獲得每個creditType的總數?
對於防爆:creditType:傳輸=,creditType:買=,creditType:花=, creditType:獎=,creditType:??預收=,
謝謝!
你想要基於信用類型的「信用」總數嗎? –
是的是Surjeet Bhadauriya先生。你能幫我解決嗎? –