Преглед изворни кода

商品增加仅发货区域

abiao пре 4 година
родитељ
комит
acac7cf379

+ 2 - 0
app/models/product.rb

@@ -278,6 +278,7 @@ class Product < ActiveRecord::Base
             field :is_only_new
             field :specification
             field :no_delivery_area
+            field :only_delivery_area
             field :video_state
             field :video_url
             field :size_name
@@ -339,6 +340,7 @@ class Product < ActiveRecord::Base
             field :is_only_new
             field :specification
             field :no_delivery_area
+            field :only_delivery_area
             field :video_state
             field :video_url
 

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

@@ -44,6 +44,7 @@ zh-CN:
 
         specification: 规格
         no_delivery_area: 不发货地区
+        only_delivery_area: 仅发货地区
         video_state: 显示视频
         video_url: 视频地址
         size_id: 规格一

+ 11 - 0
db/migrate/20211122032358_add_delivery_area_column_to_products.rb

@@ -0,0 +1,11 @@
+# This migration and CreateVersionAssociations provide the necessary
+# schema for tracking associations.
+class AddDeliveryAreaColumnToProducts < ActiveRecord::Migration
+  def self.up
+    add_column :products, :only_delivery_area, :string, :default=>""
+  end
+
+  def self.down
+    remove_column :products, :only_delivery_area
+  end
+end