将全局范围应用于模型时,应用的范围会附加到查询生成器的末尾。
我正在寻找一种在查询构建器开头附加 Scope 的方法。 就像第一个 where 任何查询的条件一样。
珍惜你的时间!
查询返回:
select * from banners where locale = ? and tenant_id = ?
预期查询:
select * from banners where tenant_id = ? and locale = ?
将全局范围应用于模型时,应用的范围会附加到查询生成器的末尾。
我正在寻找一种在查询构建器开头附加 Scope 的方法。 就像第一个 where 任何查询的条件一样。
珍惜你的时间!
查询返回:
select * from banners where locale = ? and tenant_id = ?
预期查询:
select * from banners where tenant_id = ? and locale = ?