abiao лет назад: 2
Родитель
Сommit
02e97f5eca
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      app/models/promotion.rb

+ 3 - 0
app/models/promotion.rb

@@ -3,6 +3,7 @@ class Promotion < ActiveRecord::Base
     self.table_name = "promotions"
     validates :begin_time,:end_time,:name,:order_type, presence: true
     has_and_belongs_to_many :depart_record
+    has_and_belongs_to_many :products
 
     def prodcut1
       prd1 = Product.where("id = ?", self.prod1).first
@@ -159,6 +160,7 @@ class Promotion < ActiveRecord::Base
               value.to_f / 100
             end
           end
+          field :products
           field :is_enable
           field :created_at
         end
@@ -245,6 +247,7 @@ class Promotion < ActiveRecord::Base
           field :send_nums5
           field :cash
           field :cent
+          field :products
           field :is_enable
         end
     end