Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query.setOrder("-createdAt");不起作用哦。 #19

Open
AllLuckly opened this issue Sep 27, 2019 · 0 comments
Open

query.setOrder("-createdAt");不起作用哦。 #19

AllLuckly opened this issue Sep 27, 2019 · 0 comments

Comments

@AllLuckly
Copy link

  ///查询关联数据
  _queryPointer() {
    BmobQuery<Diary> query = BmobQuery();
    query.setInclude("author");
    query.setOrder("-createdAt");
    query.queryObjects().then((data) {
      List<Diary> blogs = data.map((i) => Diary.fromJson(i)).toList();
      print(blogs);
      for (Diary blog in blogs) {
        if (blog != null) {
          print(blog.objectId);
          print(blog.title);
          print(blog.content);
          if (blog.author != null) {
            print("rrrr"+blog.author.objectId + " yyyyyy "+ userId + blog.author.objectId.compareTo(userId).toString());
            if(blog.author.objectId.compareTo(userId) == 0){
              restaurants.add(blog);
              print(blog.author.objectId + "rrrr");
            }

          }
        }
      }
      setState(() {

      });
    }).catchError((e) {
      DataPlugin.toast(BmobError.convert(e).error);
    });
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant