标签:inpu 多条件 student public like code ret function fun
public function index(Request $request)
{
$data = Student::where(function ($query) use ($request) {
$id = $request->input(‘id‘);
$name = $request->input(‘name‘);
$query->where(‘id‘, ‘like‘, ‘%‘ . $id . ‘%‘)->where(‘sname‘, ‘like‘, ‘%‘ . $name . ‘%‘);
})->get()->toArray();
return dd($data);
}
标签:inpu 多条件 student public like code ret function fun
原文地址:https://www.cnblogs.com/yaoliuyang/p/12864840.html