我有以下有效的代码:
$name = 'jhon';
$users = DB::table('account')->where('login', '=', $name)->get();
如何指定 AND 参数以便可以查询多个条件?
$login = $request->login;
$password = $request->password;
$users = DB::table('account')->where([
['login', '=', $login],
['password', '=', $password]
])->get();
不工作。
$users = DB::table('account')
->where('login', '=', $login and 'password', '=', $password)->get();
澄清一下,我专门寻找查询构建器解决方案,而不是 Eloquent 解决方案。