fix category type error

This commit is contained in:
邱博亞 2023-09-13 12:16:38 +08:00
parent 252c8d9ae2
commit 6ca8a557f0
1 changed files with 3 additions and 1 deletions

View File

@ -322,7 +322,9 @@ class SiteFeedAnnc
end end
self.collection.aggregate(pipeline).collect do |data| self.collection.aggregate(pipeline).collect do |data|
tmp = data['data'] tmp = data['data']
tmp['category'] = tmp['category'][locale] if !(tmp['category'].is_a? String)
tmp['category'] = tmp['category'][locale]
end
if @image_version != 'thumb' && !@image_version.nil? if @image_version != 'thumb' && !@image_version.nil?
if @image_version == 'mobile' if @image_version == 'mobile'
tmp["img_src"] = tmp["image"]["mobile"] tmp["img_src"] = tmp["image"]["mobile"]