小编Ale*_*off的帖子

对数据库中的一列使用多个条件进行查询,laravel

我需要获取级别从一个值到另一个值的用户。好吧,我不知道如何进行正确的查询。这是我的错误尝试:

$thread = Threads::findOrFail($id);

$users= Users::where(
          ['rank', '>', $thread->rank_from], 
          ['rank', '<', $thread->rank_to]
          )->get();
Run Code Online (Sandbox Code Playgroud)

我的错误是:

未找到列:1054 'where 子句' 中的未知列 '0'(SQL:select * from accounts where (0 = rank and 1 = > and 2 = 21))

谢谢!

php laravel

1
推荐指数
1
解决办法
140
查看次数

标签 统计

laravel ×1

php ×1