{ :companies => { :malls => { :id => 1},:products => {:title =-6ren">
gpt4 book ai didi

mysql - 如何将条件 "LIKE ? %something%"添加到此连接的产品标题中

转载 作者:行者123 更新时间:2023-11-29 15:00:07 26 4
gpt4 key购买 nike

Product.find(:all,
:conditions => { :companies => { :malls => { :id => 1},:products => {:title => "nexus one"} }},
:joins => [:company => :mall])

最佳答案

我找到了解决方案,我想我必须休息一下,

Product.find(:all,:conditions => ['title LIKE ? and mall_id = ?', "%#{search}%",mall_id],
:joins => [:company => :mall])

关于mysql - 如何将条件 "LIKE ? %something%"添加到此连接的产品标题中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3459485/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com