sql查询

This commit is contained in:
huang 2016-05-10 10:00:28 +08:00
parent 2fb6852086
commit 5880a12290
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -33,7 +33,7 @@
</div>
<div class="block-slice"></div>
<div class="teacher-social-block">
<div class="block-num">8000</div>
<div class="block-num"><%= org_teacher_resource_count(org_teacher) %>8000</div>
<div class="block-title">资源数</div>
</div>
</div>