Parcourir la source

增加促销活动增加订单类型限制

abiao il y a 5 ans
Parent
commit
7fb6dd7928
1 fichiers modifiés avec 6 ajouts et 6 suppressions
  1. 6 6
      app/models/promotion.rb

+ 6 - 6
app/models/promotion.rb

@@ -6,7 +6,7 @@ class Promotion < ActiveRecord::Base
     def prodcut1
       prd1 = Product.where("id = ?", self.prod1).first
       if !prd1.blank?
-        return format("%s-%d",prd1.Name,self.nums1)
+        return format("%s-%d",prd1.name,self.nums1)
       else
         return "不存在"
       end
@@ -15,7 +15,7 @@ class Promotion < ActiveRecord::Base
     def prodcut2
       prd1 = Product.where("id = ?", self.prod1).first
       if !prd1.blank?
-        return format("%s-%d",prd1.Name,self.nums1)
+        return format("%s-%d",prd1.name,self.nums1)
       else
         return "不存在"
       end
@@ -25,7 +25,7 @@ class Promotion < ActiveRecord::Base
     def prodcut3
       prd1 = Product.where("id = ?", self.prod1).first
       if !prd1.blank?
-        return format("%s-%d",prd1.Name,self.nums1)
+        return format("%s-%d",prd1.name,self.nums1)
       else
         return "不存在"
       end
@@ -35,7 +35,7 @@ class Promotion < ActiveRecord::Base
     def send_prodcut1
       prd1 = Product.where("id = ?", self.prod1).first
       if !prd1.blank?
-        return format("%s-%d",prd1.Name,self.nums1)
+        return format("%s-%d",prd1.name,self.nums1)
       else
         return "不存在"
       end
@@ -44,7 +44,7 @@ class Promotion < ActiveRecord::Base
     def send_prodcut2
       prd1 = Product.where("id = ?", self.prod1).first
       if !prd1.blank?
-        return format("%s-%d",prd1.Name,self.nums1)
+        return format("%s-%d",prd1.name,self.nums1)
       else
         return "不存在"
       end
@@ -54,7 +54,7 @@ class Promotion < ActiveRecord::Base
     def send_prodcut3
       prd1 = Product.where("id = ?", self.prod1).first
       if !prd1.blank?
-        return format("%s-%d",prd1.Name,self.nums1)
+        return format("%s-%d",prd1.name,self.nums1)
       else
         return "不存在"
       end