0

我有两个类“优惠”和“商店”。Offer 类有一个名为“storeId”的指针字段,它指向“Stores”类。我需要查询特定类别的商品,属于我当前位置 20 公里半径内的商店。返回的存储对象应显示在列表视图中。

这是我在 ParseQueryAdapter 子类的 onCreate() 方法中的代码。

ParseQuery offersQuery = new ParseQuery("Offers");
offersQuery.whereEqualTo("category", category);
ParseQuery storesQuery = new ParseQuery("Stores");
storesQuery.whereWithinKilometers("location",myLoc,20);
storesQuery.whereMatchedKeyInQuery("objectId", "storeId", offersQuery);
return storesQuery

storesQuery 返回一个空列表。

我错过了什么?另外,请忽略上面代码中的任何错别字

谢谢

4

0 回答 0