0
嗨可以問一些幫助它沒有輸出這個原始查詢,原始查詢沒有輸出
$userproj_id = UserProject::select('projid')->where('user_id', $id)->get()->toArray();
$flattenid = array_flatten($userproj_id);
foreach ($flattenid as $projid) {
$projidarr [] = $projid;
}
$users = DB::select('select * from project where projid in (?) and user_id = 3 ', $projidarr);
,但如果我將手動做這樣的,它工作正常..
$users = DB::select('select * from project where projid in (?) and user_id = 3 ', ['12345']);
但當我手動執行此操作時不再輸出。
$users = DB::select('select * from project where projid in (?) and user_id = 3 ', ['12345','11111']);
在此先感謝您。
http://stackoverflow.com/a/35725251/4248472? – Zimmi