Skip to content

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

@AllLuckly

Description

@AllLuckly
  ///查询关联数据
  _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);
    });
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions