CakePHP URL - 将命名字段指定为“null”

时间:2016-11-05 15:52:56

标签: cakephp

我正在开发一个连接第三方CakePHP API系统的应用程序。 以下是网址的示例输出:

https://<server>/api/events.json

输出:

{"events":[{"Event":{"Id":"11902","MonitorId":"5","Name":"New Event","Cause":"Continuous","StartTime":"2016-08-15 17:10:00","EndTime":null,"Width":"2304","Height":"1296","Length":"319.81","Frames":"1600","AlarmFrames":"0","TotScore":"0","AvgScore":"0","MaxScore":"0","Archived":"0","Videoed":"0","Uploaded":"0","Emailed":"0","Messaged":"0","Executed":"0","Notes":""},"thumbData":""},{"Event":{"Id":"11903","MonitorId":"7","Name":"New Event","Cause":"Continuous","StartTime":"2016-08-15 17:10:00","EndTime":"2016-08-15 17:11:00" ,"Width":"1280","Height":"720","Length":"316.73","Frames":"1900","AlarmFrames":"0","TotScore":"0","AvgScore":"0","MaxScore":"0","Archived":"0","Videoed":"0","Uploaded":"0","Emailed":"0","Messaged":"0","Executed":"0","Notes":""},"thumbData":""}

请注意,在某些情况下,EndTime字段为空,在某些情况下则不是。我现在想要创建一个只返回EndTime为空的字段的URL。

API允许使用命名过滤器。例如:

https://<server>/api/events/index/EndTime >=: 2016-11-07 10:10:10.json

使用EndTime&gt;准确返回所有值指定的值。

如何要求EndTime = null?

我试过了:

https://<server>/api/events/index/EndTime =: null.json

这不起作用(也尝试过引号)

感谢

0 个答案:

没有答案