abiao пре 5 година
родитељ
комит
8bcdb8044f

+ 3 - 0
app/models/product.rb

@@ -178,6 +178,7 @@ class Product < ActiveRecord::Base
             field :color_name
             field :relate_product_id
             field :show_flag
+            field :live
             field :created_at
             field :updated_at
         end
@@ -237,6 +238,7 @@ class Product < ActiveRecord::Base
             field :color_name
             field :relate_product_id
             field :show_flag
+            field :live
             field :created_at
             field :updated_at
         end
@@ -292,6 +294,7 @@ class Product < ActiveRecord::Base
             end
             field :relate_product_id
             field :show_flag
+            field :live
         end
 
     end

+ 2 - 1
config/locales/models/product.yml

@@ -50,4 +50,5 @@ zh-CN:
         size_name: 规格一
         color_name: 规格二
         relate_product_id: 关联主商品
-        show_flag: 主商品标记
+        show_flag: 主商品标记
+        live: 是否直播

+ 3 - 0
db/migrate/20210104114641_create_live_broads.rb

@@ -20,10 +20,13 @@ class CreateLiveBroads < ActiveRecord::Migration
       t.timestamps
     end
     add_index :live_broads, :room_id
+    add_column :products, :live, :boolean, :default=>false
 
   end
 
   def down
   	drop_table :live_broads
+    remove_column :products, :live
+
   end
 end