简体   繁体   中英

how to filter data from related table (Parse)

Hiii guys i have to tables, first is "User" table and second is "PaidChatroom" table here is the structure

这是一个用户表

这是一个PaidChatroom表

This the code i used for nearest user and it is working fine.

PFGeoPoint *userGeoPoint=[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude longitude:locationManager.location.coordinate.longitude];


PFQuery *query = [PFQuery queryWithClassName:@"_User"];  
[query whereKey:@"location" nearGeoPoint:userGeoPoint withinKilometers:5000.0];
arrAllUser=[[NSMutableArray alloc]init];


[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
    arrAllUser=[objects mutableCopy];


}];

i want only those user who is nearest to me and purchased the dating, how can i filter the data.

PFGeoPoint *userGeoPoint=[PFGeoPoint geoPointWithLatitude:currentLocation.coordinate.latitude longitude:locationManager.location.coordinate.longitude];


PFQuery *query = [PFQuery queryWithClassName:@"_User"];  
[query whereKey:@"location" nearGeoPoint:userGeoPoint withinKilometers:5000.0];
arrAllUser=[[NSMutableArray alloc]init];

[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error)
{
    arrAllUser=[objects mutableCopy];

    // Perform your second query here on the objects received inside this block for Purchased dating
}];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM