Model::where(function ($query) use ($a,$b) {
$query->where('a', '=', $a)
->orWhere('b', '=', $b);
})
===============================if (isset($_GET["ids"])) { $ids = $_GET["ids"]; $id_list = explode(",", $ids); $notes = Note::where(function ($query) use ($id_list) { $query->where(true); foreach ($id_list as &$id) { $query->orWhere('id', $id); } }); $notes = $notes->get(); return response()->json($notes); }
沒有留言:
發佈留言