From 5880a12290a32b967d83ca819e9777cfcb699e88 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 10 May 2016 10:00:28 +0800 Subject: [PATCH] =?UTF-8?q?sql=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/organizations_helper.rb | 4 ++++ app/views/organizations/_show_teachers.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/organizations_helper.rb b/app/helpers/organizations_helper.rb index 981921d0b..f84c71a59 100644 --- a/app/helpers/organizations_helper.rb +++ b/app/helpers/organizations_helper.rb @@ -169,4 +169,8 @@ module OrganizationsHelper end end + def org_teacher_resource_count user + results = Attachment.find_by_sql("SELECT * FROM `attachments` where author_id = #{user.user_id};") + end + end diff --git a/app/views/organizations/_show_teachers.html.erb b/app/views/organizations/_show_teachers.html.erb index a95efbfa9..28e308b49 100644 --- a/app/views/organizations/_show_teachers.html.erb +++ b/app/views/organizations/_show_teachers.html.erb @@ -33,7 +33,7 @@
-
8000
+
<%= org_teacher_resource_count(org_teacher) %>8000
资源数