|
本帖最后由 yiimiao 于 2015-2-4 15:33 编辑
我有两个表,test1表里的字段tt关联了test2表,test2表时有字段name
现在我想得到的是当使用[includefilter]筛选test2表的name数据,当筛选结果为空时(即tt数据为空),整个查询都不返回数据。
请问怎么设置关联查询条件呢?
我现在这样测试查询。当tt数据为空时还是会有test1表的数据的。
filter[include]=tt&filter[includefilter][test2][where][name]=xxx
- (
- [id] => 54c7a7f89dfa3523615a53cb
- [name] => ta1
- [createdAt] => 2015-01-27T15:00:08.033Z
- [updatedAt] => 2015-01-27T15:00:08.033Z
- [tt] => Array
- (
- )
- )
复制代码 如以上返回的数据tt为关联字段,现在tt为空时。我就不想要这个数据。怎么查询
|
|