开发者

How to add condition "LIKE ? %something%" to the product title to this join

Product.find(:all,
    :conditions => { :companies =>开发者_开发技巧; { :malls => { :id => 1},:products => {:title => "nexus one"} }},
    :joins => [:company => :mall])


I found the solution, I think I have to take break,

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜