news author解析
This commit is contained in:
parent
426d382ee5
commit
662fc02a80
|
@ -32,8 +32,13 @@ module Mobile
|
|||
news_expose :title
|
||||
|
||||
expose :author,using: Mobile::Entities::User do |f, opt|
|
||||
#n = f[:author]
|
||||
f.author if f.respond_to?(:author)
|
||||
obj = nil
|
||||
if f.is_a?(::News) && f.respond_to?(:author)
|
||||
obj = f.send(:author)
|
||||
elsif f.is_a?(Hash) && f.key?(:author)
|
||||
obj = f[:author]
|
||||
end
|
||||
obj
|
||||
end
|
||||
#作者id
|
||||
news_expose :author_id
|
||||
|
|
Loading…
Reference in New Issue