|
@@ -32,6 +32,25 @@ class Promotion < ActiveRecord::Base
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ def prodcut4
|
|
|
|
|
+ prd1 = Product.where("id = ?", self.prod4).first
|
|
|
|
|
+ if !prd1.blank?
|
|
|
|
|
+ return format("%s-%d",prd1.name,self.nums4)
|
|
|
|
|
+ else
|
|
|
|
|
+ return "不存在"
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ def prodcut5
|
|
|
|
|
+ prd1 = Product.where("id = ?", self.prod5).first
|
|
|
|
|
+ if !prd1.blank?
|
|
|
|
|
+ return format("%s-%d",prd1.name,self.nums5)
|
|
|
|
|
+ else
|
|
|
|
|
+ return "不存在"
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
def send_prodcut1
|
|
def send_prodcut1
|
|
|
prd1 = Product.where("id = ?", self.send_prod1).first
|
|
prd1 = Product.where("id = ?", self.send_prod1).first
|
|
|
if !prd1.blank?
|
|
if !prd1.blank?
|
|
@@ -60,6 +79,27 @@ class Promotion < ActiveRecord::Base
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ def send_prodcut4
|
|
|
|
|
+ prd1 = Product.where("id = ?", self.send_prod4).first
|
|
|
|
|
+ if !prd1.blank?
|
|
|
|
|
+ return format("%s-%d",prd1.name,self.send_nums4)
|
|
|
|
|
+ else
|
|
|
|
|
+ return "不存在"
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ def send_prodcut5
|
|
|
|
|
+ prd1 = Product.where("id = ?", self.send_prod5).first
|
|
|
|
|
+ if !prd1.blank?
|
|
|
|
|
+ return format("%s-%d",prd1.name,self.send_nums5)
|
|
|
|
|
+ else
|
|
|
|
|
+ return "不存在"
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
TYPE_ENUM = [["普通",0],["秒杀",1],["店长",2]]
|
|
TYPE_ENUM = [["普通",0],["秒杀",1],["店长",2]]
|
|
|
|
|
|
|
|
|
|
|
|
@@ -97,9 +137,14 @@ class Promotion < ActiveRecord::Base
|
|
|
field :prodcut1
|
|
field :prodcut1
|
|
|
field :prodcut2
|
|
field :prodcut2
|
|
|
field :prodcut3
|
|
field :prodcut3
|
|
|
|
|
+ field :prodcut4
|
|
|
|
|
+ field :prodcut5
|
|
|
field :send_prodcut1
|
|
field :send_prodcut1
|
|
|
field :send_prodcut2
|
|
field :send_prodcut2
|
|
|
field :send_prodcut3
|
|
field :send_prodcut3
|
|
|
|
|
+ field :send_prodcut4
|
|
|
|
|
+ field :send_prodcut5
|
|
|
|
|
+
|
|
|
field :cash do
|
|
field :cash do
|
|
|
label "代办金(元)"
|
|
label "代办金(元)"
|
|
|
formatted_value do # used in form views
|
|
formatted_value do # used in form views
|
|
@@ -145,9 +190,13 @@ class Promotion < ActiveRecord::Base
|
|
|
field :prodcut1
|
|
field :prodcut1
|
|
|
field :prodcut2
|
|
field :prodcut2
|
|
|
field :prodcut3
|
|
field :prodcut3
|
|
|
|
|
+ field :prodcut4
|
|
|
|
|
+ field :prodcut5
|
|
|
field :send_prodcut1
|
|
field :send_prodcut1
|
|
|
field :send_prodcut2
|
|
field :send_prodcut2
|
|
|
field :send_prodcut3
|
|
field :send_prodcut3
|
|
|
|
|
+ field :send_prodcut4
|
|
|
|
|
+ field :send_prodcut5
|
|
|
field :is_enable
|
|
field :is_enable
|
|
|
field :cash
|
|
field :cash
|
|
|
field :cent
|
|
field :cent
|
|
@@ -176,12 +225,20 @@ class Promotion < ActiveRecord::Base
|
|
|
field :nums2
|
|
field :nums2
|
|
|
field :prod3
|
|
field :prod3
|
|
|
field :nums3
|
|
field :nums3
|
|
|
|
|
+ field :prod4
|
|
|
|
|
+ field :nums4
|
|
|
|
|
+ field :prod5
|
|
|
|
|
+ field :nums5
|
|
|
field :send_prod1
|
|
field :send_prod1
|
|
|
field :send_nums1
|
|
field :send_nums1
|
|
|
field :send_prod2
|
|
field :send_prod2
|
|
|
field :send_nums2
|
|
field :send_nums2
|
|
|
field :send_prod3
|
|
field :send_prod3
|
|
|
field :send_nums3
|
|
field :send_nums3
|
|
|
|
|
+ field :send_prod4
|
|
|
|
|
+ field :send_nums4
|
|
|
|
|
+ field :send_prod5
|
|
|
|
|
+ field :send_nums5
|
|
|
field :cash
|
|
field :cash
|
|
|
field :cent
|
|
field :cent
|
|
|
field :is_enable
|
|
field :is_enable
|