From 064dc81ed67671cebcf414e55802b387d2712127 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 16 Mar 2016 13:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=85=AC=E5=85=B1=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=88=A0=E9=99=A4=E8=B5=84=E6=BA=90=E5=90=8E=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E5=AD=97=E4=B8=8D=E5=87=8F=E5=B0=91=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=EF=BC=88=E5=A2=9E=E5=8A=A0=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=9B=9E=E8=B0=83=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 68accdfd0..7ba756806 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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