Problems with join ERROR: 1054

Problems with join ERROR: 1054

我尝试使用 join,并给出一个数组作为条件:

$task = Task::join('oc_groups', function($join) use ($filter) {
    foreach($filter['groups']['data'] as $key => $value) {
        $join->on('oc_groups.id', $value); 
    }
}); 

但我收到错误消息:

SQLSTATE[42S22]: Column not found: 1054 Unknown column '1' in 'on clause' (SQL: select oc_tasks.title as task_title from oc_tasks inner join oc_groups on oc_groups.id = 1 where oc_tasks.task_date between 2017-07-01 and 2017-07-31)

1$value的内容。我做错了什么? - table oc_groups 有一个名为 id.

的字段

因为您在这两个表之间没有任何关系,所以尝试不加入。像这样

select `oc_tasks`.`title` as `task_title` from `oc_tasks` ,`oc_groups`  
where `oc_tasks`.`task_date` between 2017-07-01 and 2017-07-31 and `oc_groups`.`id` = `1`