Explorar el Código

add orders list file

abiao hace 4 años
padre
commit
301941a484
Se han modificado 1 ficheros con 12 adiciones y 2 borrados
  1. 12 2
      app/models/product_warn.rb

+ 12 - 2
app/models/product_warn.rb

@@ -3,6 +3,7 @@ class ProductWarn < ActiveRecord::Base
   has_paper_trail
   self.table_name = "product_warns"
   validates :happen_time,:product_id,:sale_90,presence: true
+  TYPE_ENUM = [["直营","direct_sale"],["店铺专区","shop_sale"],["积分专区","cent_sale"]]
 
   rails_admin do
     navigation_label '商品管理'
@@ -14,7 +15,12 @@ class ProductWarn < ActiveRecord::Base
       field :happen_time
       field :product_id
       field :product_name
-      field :product_type
+      # field :product_type
+      field :product_type, :enum do
+        enum do
+          TYPE_ENUM
+        end
+      end
       field :product_size
       field :sale_90
       field :sale_30
@@ -33,7 +39,11 @@ class ProductWarn < ActiveRecord::Base
       field :happen_time
       field :product_id
       field :product_name
-      field :product_type
+      field :product_type, :enum do
+        enum do
+          TYPE_ENUM
+        end
+      end
       field :product_size
       field :sale_90
       field :sale_30