我正在尝试使用whereIn()查找可以在此数组中找到的具有“ prov”的记录;
array:3 [▼
0 => array:6 [▼
"id" => 1
"contest_id" => 1
"contest_zone_id" => 1
"province" => "ON"
"created_at" => "2018-06-20 13:37:45"
"updated_at" => "2018-06-20 13:37:45"
]
1 => array:6 [▼
"id" => 2
"contest_id" => 1
"contest_zone_id" => 1
"province" => "SK"
"created_at" => "2018-06-20 13:37:45"
"updated_at" => "2018-06-20 13:37:45"
]
2 => array:6 [▼
"id" => 3
"contest_id" => 1
"contest_zone_id" => 1
"province" => "NB"
"created_at" => "2018-06-20 13:37:45"
"updated_at" => "2018-06-20 13:37:45"
]
]
所以我可以做到这一点;
->whereIn('prov', $provinces)
但是,在我的2个表中,“ prov”和“ province”不相同,因此无法正常工作。有没有一种方法可以明确声明要比较的列?
谢谢!
使用FIX更新
需要将数组简化为您要匹配的字段。