Remove send_mail to admin.

This commit is contained in:
邱博亞 2023-12-21 21:06:40 +08:00
parent 5d7769270a
commit 24c8845f28
2 changed files with 3 additions and 6 deletions

View File

@ -74,8 +74,7 @@ class Admin::PropertyHiresController < OrbitAdminController
def destroy def destroy
property = Property.find(params[:id]) rescue nil property = Property.find(params[:id]) rescue nil
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue [] email = MemberProfile.where(:id.in=>property.owners).collect{|v| v.email}
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
Admin::PropertyHiresHelper::HireMethod.send_mail('delete',email,property.id,nil,nil,current_user.id) Admin::PropertyHiresHelper::HireMethod.send_mail('delete',email,property.id,nil,nil,current_user.id)
property.destroy if !property.nil? property.destroy if !property.nil?
if params[:page] if params[:page]
@ -110,8 +109,7 @@ class Admin::PropertyHiresController < OrbitAdminController
property.p_hire_fields.each{|t| t.destroy if t["to_delete"] == true} property.p_hire_fields.each{|t| t.destroy if t["to_delete"] == true}
else else
property.update_attributes(@property_params) property.update_attributes(@property_params)
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue [] email = MemberProfile.where(:id.in=>property.owners).collect{|v| v.email}
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
Admin::PropertyHiresHelper::HireMethod.send_mail('edit',email,property.id,nil,nil,current_user.id) Admin::PropertyHiresHelper::HireMethod.send_mail('edit',email,property.id,nil,nil,current_user.id)
end end
redirect_to params[:referer_url] redirect_to params[:referer_url]

View File

@ -280,8 +280,7 @@ class PropertyHiresController < ApplicationController
hire.passed = true if PropertyHireSetting.auto_approve_enabled? hire.passed = true if PropertyHireSetting.auto_approve_enabled?
hire.save hire.save
if !property.nil? && !is_admin_page if !property.nil? && !is_admin_page
email = Array(MemberProfile.find(property.owners)).collect{|v| v.email} rescue [] email = MemberProfile.where(:id.in=>property.owners).collect{|v| v.email}
email = User.all.select{|v| v.is_admin? && v.user_name != 'rulingcom'}.collect{|v| v.member_profile.email} if email.length == 0
email << hire.hiring_person_email email << hire.hiring_person_email
email = email.select{|e| e.present?} email = email.select{|e| e.present?}
Admin::PropertyHiresHelper::HireMethod.send_mail('p_hire',email,property.id,nil,hire.id,(current_user.id rescue nil)) Admin::PropertyHiresHelper::HireMethod.send_mail('p_hire',email,property.id,nil,hire.id,(current_user.id rescue nil))