|
|
|
@ -131,8 +131,11 @@ module Mobile
|
|
|
|
|
act_expose :course_project_name #课程/项目名字
|
|
|
|
|
act_expose :activity_type_name #课程问答区/项目缺陷等
|
|
|
|
|
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
|
|
|
|
|
has_praise = false
|
|
|
|
|
current_user = options[:user]
|
|
|
|
|
false
|
|
|
|
|
obj = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?",instance.act_id,instance.act_type.to_s,current_user.id)
|
|
|
|
|
has_praise = obj.empty? ? false : true
|
|
|
|
|
has_praise
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|