quarterIdThe = params[:quarterThe_id].to_s #得到--本季度操作--对话框
department = params[:department_id] #得到选择的部门名称
upThe,downThe = getUpTheDownThe(quarterIdThe) #这是我自己写的一个方法,没有错误
busiesses = Business.find_by_sql["SELECT d.name FROM businesses AS b
JOIN employees AS e ON (b.employee_id = e.id)
JOIN departments AS d ON (e.department_id = d.id)
WHERE d.code = Department AND b.out_date <= UpThe AND b.out_date > DownThe ",{:Department => 'department',:UpThe=> 'upThe',:DownThe=> 'downThe'}]
我用的rails,这是在控制里面写的代码,主要是find_by_sql后边的代码有问题,总是提示说参数个数错误,求各位帮忙解决,或者是在model中写这个方法的话代码应该怎样写
蝴蝶刀刀
慕尼黑的夜晚无繁华
相关分类