fixed default widget for tags

This commit is contained in:
Matthew K. Fu JuYuan 2013-09-03 16:17:45 +08:00
parent 915ea066d6
commit e1c57c6843
1 changed files with 2 additions and 2 deletions

View File

@ -18,11 +18,11 @@ class DefaultWidgetController< OrbitWidgetController
if !params["tag_id"].blank?
if params["category_id"].blank? #has tag no cate
result = eval(@ori_query)
result.selector[:tagged_ids] = { "$in" => params['tag_id'].collect{|t| BSON::ObjectId(t)}}
result.selector[:tagged_ids] = { "$in" => params['tag_id'] }
else #has tag and cate
result = eval(@ori_query)
result.selector[get_category_field_name] = { "$in" => params['category_id'].collect{|t| BSON::ObjectId(t)}}
result.selector[:tagged_ids] = { "$in" => params['tag_id'].collect{|t| BSON::ObjectId(t)}}
result.selector[:tagged_ids] = { "$in" => params['tag_id'] }
end
elsif params["category_id"].blank? #no tag no cate
result = eval(@ori_query)