ソースを参照

增加商品搜索关键字

abiao 4 年 前
コミット
f11ac6bc23
共有3 個のファイルを変更した16 個の追加1 個の削除を含む
  1. 3 0
      app/models/product.rb
  2. 2 1
      config/locales/models/product.yml
  3. 11 0
      db/migrate/20210913032357_add_key_words_column_to_products.rb

+ 3 - 0
app/models/product.rb

@@ -223,6 +223,7 @@ class Product < ActiveRecord::Base
                 end
             end
             field :out_nums
+            field :key_words
             field :created_at
             field :updated_at
         end
@@ -295,6 +296,7 @@ class Product < ActiveRecord::Base
                 end
             end
             field :out_nums
+            field :key_words
             field :created_at
             field :updated_at
         end
@@ -361,6 +363,7 @@ class Product < ActiveRecord::Base
             field :min_purchase
             field :pv
             field :out_nums
+            field :key_words
         end
 
     end

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

@@ -59,4 +59,5 @@ zh-CN:
         stock_cycle: 备货周期
         min_purchase: 最低进货量
         product_no: 商品编号
-        out_nums: 出库数
+        out_nums: 出库数
+        key_words: 搜索关键字

+ 11 - 0
db/migrate/20210913032357_add_key_words_column_to_products.rb

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