|
|
@ -1614,10 +1614,10 @@ class UsersController < ApplicationController
|
|
|
|
# 删除用户资源,分为批量删除 和 单个删除,只能删除自己上传的资源
|
|
|
|
# 删除用户资源,分为批量删除 和 单个删除,只能删除自己上传的资源
|
|
|
|
def user_resource_delete
|
|
|
|
def user_resource_delete
|
|
|
|
if params[:resource_id].present?
|
|
|
|
if params[:resource_id].present?
|
|
|
|
Attachment.where("author_id = #{User.current.id}").delete(params[:resource_id])
|
|
|
|
Attachment.where("author_id =? and id =?", User.current.id, params[:resource_id]).first.destroy
|
|
|
|
elsif params[:checkbox1].present?
|
|
|
|
elsif params[:checkbox1].present?
|
|
|
|
params[:checkbox1].each do |id|
|
|
|
|
params[:checkbox1].each do |id|
|
|
|
|
Attachment.where("author_id = #{User.current.id}").delete(id)
|
|
|
|
Attachment.where("author_id =? and id =?", User.current.id, id).first.destroy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
@user = User.current
|
|
|
|
@user = User.current
|
|
|
|