fix anonymous tiding show user avatar bug

dev_ec
p31729568 5 years ago
parent ba152de10a
commit 587bbab481

@ -22,4 +22,10 @@ class Tiding < ApplicationRecord
value
end
def anonymous?
(container_type == 'StudentWorksScore' && extra.to_i == 3) ||
(container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'AppealResult') ||
(container_type == 'StudentWorksScoresAppeal' && parent_container_type == 'StudentWork' && tiding_type == 'System')
end
end

@ -17,8 +17,13 @@ json.homework_type homework_type
json.time tiding.how_long_time
json.new_tiding tiding.unread?(@onclick_time)
# 需要系统头像
show_system_user = tiding.trigger_user_id.zero? ||
(tiding.trigger_user_id == 1 && tiding.tiding_type == 'System') ||
tiding.anonymous?
json.trigger_user do
if tiding.trigger_user_id.zero? || (tiding.trigger_user_id == 1 && tiding.tiding_type == 'System')
if show_system_user
json.id 0
json.name "系统"
json.login ""

Loading…
Cancel
Save