[AsyncRequest performGetRequestWithUrl:[NSString stringWithFormat:@"http://%@/api/streams/%d", @"server.herokuapp.com", userId]
completionHandler:^(NSDictionary *result, NSError *error) {
// Create new SBJSON parser object
NSError *e;
NSArray *jsonArray =[NSJSONSerialization JSONObjectWithData:result options:NSJSONReadingMutableContainers error: &e];
NSLog(@"parse result to JSON object with jsonArray: %@ and error: %@", jsonArray, e.description);
if ([jsonArray valueForKey:@"error"]) {
return nil;
}
NSLog(@"getStreams size of the return array: %d", [jsonArray count]);
NSMutableArray* data = [[NSMutableArray alloc] initWithCapacity:0];
if (jsonArray) {
data = [[NSMutableArray alloc] initWithCapacity:[jsonArray count]];
for (NSDictionary *item in jsonArray) {
NSLog(@"item: %@", item);
[data addObject:[[Stream …Run Code Online (Sandbox Code Playgroud) 有没有一种简单的方法可以获取带有时间戳==昨天的数据?
我只想要昨天的数据。
SELECT
COUNT(t0.user_id) AS t0_qt_AC5uO9oi
FROM
`{something here}` AS t0
WHERE
(t0.event_type = 'XXXXX')
ORDER BY
t0_qt_AC5uO9oi ASC;
Run Code Online (Sandbox Code Playgroud)
不确定什么是最好的方法。