我的实训
This commit is contained in:
parent
10185d9850
commit
b05bd236cd
|
|
@ -665,10 +665,14 @@ class UsersController < ApplicationController
|
|||
@shixuns = paginateHelper @shixuns, @limit
|
||||
|
||||
# 我参入的
|
||||
id = []
|
||||
ids = Shixun.find_by_sql("select id from shixun_members where role=2 and user_id=#{@user.id}")
|
||||
ids2 = Shixun.find_by_sql("select id from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})")
|
||||
|
||||
@join_shixuns = Shixun.find_by_sql("select * from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})")
|
||||
ids = ids.map{|shixun| shixun.id} unless ids.blank?
|
||||
ids2 = ids2.map{|shixun| shixun.id} unless ids2.blank?
|
||||
id = ids + ids2
|
||||
id = id.uniq
|
||||
@join_shixuns = Shixun.where(:shixun_id => id)
|
||||
# @join_shixuns_count = @join_shixuns.count
|
||||
# @join_shixuns_pages = Paginator.new @join_shixuns_count, @limit, params['page'] || 1
|
||||
# @join_shixuns_offset ||= @join_shixuns_pages.offset
|
||||
|
|
|
|||
Loading…
Reference in New Issue