parent
9aab10c05a
commit
064dc81ed6
|
@ -1614,10 +1614,10 @@ class UsersController < ApplicationController
|
|||
# 删除用户资源,分为批量删除 和 单个删除,只能删除自己上传的资源
|
||||
def user_resource_delete
|
||||
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?
|
||||
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
|
||||
@user = User.current
|
||||
|
|
Loading…
Reference in New Issue