关系型SQL查询数组 DB::table()->select()->where()->get();

我在这段代码中遇到了错误,该错误仅来自 'verification'< 25“小于”运算符,当我用它进行更改时,=>它不会出现错误。我如何重写这个查询?

$allRecords = DB::table('users')->select(DB::raw('CONCAT(name, " ", last_name) AS name'),'email as email_address')->where(array('verification'< 25,'is_admin'=>0,'is_approved'=>1))->orderby('id', 'DESC')->get();


繁星coding
浏览 100回答 1
1回答

MMMHUHU

尝试像下面这样$allRecords = DB::table('users')&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;->select(DB::raw('CONCAT(name, " ", last_name) AS name'),'email as email_address')&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;->where('verification', '<', 25)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;->where(array('is_admin'=>0,'is_approved'=>1))&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;->orderby('id', 'DESC')&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;->get();
打开App,查看更多内容
随时随地看视频慕课网APP