-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比賽
我怎樣才能解決這個問題?