Browse Source

直播增加级别限制

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

+ 4 - 4
app/models/live_broad.rb

@@ -7,7 +7,7 @@ class LiveBroad < ActiveRecord::Base
     has_and_belongs_to_many :depart_record
     serialize :rank_str, Array
     RANK_ENUM= [["普通会员",0], ["群主",1], ["店长", 2], ["区域代理", 3]]
-    RANK_HASH= {"0": "普通会员", "1": "群主","2": "店长","3": "区域代理"}
+    RANK_HASH=["普通会员","群主","店长","区域代理"]
 
     def before_save
       #自动取消其他置顶项
@@ -49,11 +49,11 @@ class LiveBroad < ActiveRecord::Base
           if item.length<=0
             next
           end
-          if !RANK_HASH[item.to_s].blank?
+          if !RANK_HASH[item].blank?
             if i==0
-              str=RANK_HASH[item.to_s]
+              str=RANK_HASH[item]
             else
-              str=str+","+RANK_HASH[item.to_s]
+              str=str+","+RANK_HASH[item]
             end
           end