public static int[] GetAllChatByAccountId(string accountId, string beginDate, string endDate) { List <Chat> chatList = Provider.GetAllChatByAccountId(accountId, beginDate, endDate); int[] hour = new int[24]; if (chatList.Count > 0) { //遍历对话集合 for (int i = 0; i < chatList.Count; i++) { for (int j = 0; j < 23; j++) { int count = 0; if (chatList[i].CreateTime.Hour == j) { count++; hour[j] = hour[j] + count; break; } } } return(hour); } else { return(null); } }