-2
customer = Feedback.includes(:user).where("('created_at' >= ? and
'created_at' < ? and how_did_you_hear = ? and
users.user_type = ?)",date_start,date_end,value,"customer").count
此代码匹配所有反馈不仅Feedback.user.user_type =“客户”轨SQL比赛
我怎样才能解决这个问题?