在下面给出的代码中$allZip["assigned_date"]
具有 value 2016-07-27 18:12:26
。当我尝试将它与created_at
也是时间戳字段的字段进行比较时,结果是一个空集合。
$filtered_datas = $datas->filter(function ($data) use($allZip) {
return $data->zip == $allZip["zip"] && $data->created_at < $allZip["assigned_date"];
});
数据库中存在zip
字段匹配值 from$allZip["zip"]
和created_at
字段值匹配的数据2016-07-19 18:12:26
。所以它应该返回集合中的一项,但返回一个空集合。为什么?