Browse Source

直播增加级别限制

abiao 4 years ago
parent
commit
a274a57988
1 changed files with 3 additions and 5 deletions
  1. 3 5
      app/models/live_broad.rb

+ 3 - 5
app/models/live_broad.rb

@@ -6,10 +6,8 @@ class LiveBroad < ActiveRecord::Base
     before_save :before_save
     has_and_belongs_to_many :depart_record
     serialize :rank_str, Array
-    RANK_ENUM= [["普通会员","0"], ["群主","1"], ["店长", "2"], ["区域代理", "3"]]
-    def roles_enum
-      [ [ 'role one', 1 ], [ 'role 2', 2 ], [ 'role 3', 3 ] ]
-    end
+    RANK_ENUM= [["普通会员",0], ["群主",1], ["店长", 2], ["区域代理", 3]]
+
     def before_save
       #自动取消其他置顶项
       if self.show
@@ -22,7 +20,7 @@ class LiveBroad < ActiveRecord::Base
           end
         end
       end
-      self.rank_strs="'#{self.rank_str.join("', '")}'"
+      self.rank_strs="'#{self.rank_str.join(",")}'"
     end
 
     IMG_STORE_PATH = "live_broads"