修复我参入的实训数据为空问题
This commit is contained in:
parent
6c8bbeb25d
commit
3efcdfc7dc
|
|
@ -658,11 +658,10 @@ class UsersController < ApplicationController
|
|||
# 我发布的实训
|
||||
def shixuns
|
||||
@type = params[:type]
|
||||
# 我发布的
|
||||
if @type == "1"
|
||||
ids = Shixun.find_by_sql("select id from shixun_members where role=2 and user_id=#{@user.id}")
|
||||
ids = Shixun.find_by_sql("select shixun_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})")
|
||||
ids = ids.map{|shixun| shixun.id} unless ids.blank?
|
||||
ids = ids.map{|shixun| shixun.shixun_id} unless ids.blank?
|
||||
ids2 = ids2.map{|shixun| shixun.id} unless ids2.blank?
|
||||
id = ids + ids2
|
||||
id = id.uniq
|
||||
|
|
|
|||
Loading…
Reference in New Issue