Prechádzať zdrojové kódy

订单增加用券金额

abiao 5 rokov pred
rodič
commit
729884ea12
2 zmenil súbory, kde vykonal 14 pridanie a 3 odobranie
  1. 10 1
      app/models/order.rb
  2. 4 2
      config/locales/models/order.yml

+ 10 - 1
app/models/order.rb

@@ -103,6 +103,11 @@ class Order < ActiveRecord::Base
         end
     end
 
+    def coupon_price_format
+        coupon_price_f = self.coupon_price!=0 ? ((self.coupon_price)/100.0) :0
+        return coupon_price_f.to_s
+    end
+
 
     rails_admin do 
         navigation_label '商品管理'
@@ -147,6 +152,10 @@ class Order < ActiveRecord::Base
             field :total_price_format do
                 visible true
             end
+            field :total_price_format do
+                visible true
+            end
+            field :coupon_price_format
             field :paied_price_format do
                 visible true
             end
@@ -209,7 +218,7 @@ class Order < ActiveRecord::Base
                     value!=0 ? (value/100.0):0
                 end
             end
-            field :total_price_format
+            field :coupon_price_format
             field :paied_price_format
             field :buy_price
             field :trade_no

+ 4 - 2
config/locales/models/order.yml

@@ -18,8 +18,10 @@ zh-CN:
        total_price: 订单总价
        freight: 运费
        total_price_format: 订单总价
-       paied_price_format: 支付总价(元)
-       paied_price: 支付价格(代金券/代金券/分)
+       paied_price_format: 实付金额(元)
+       paied_price: 实付金额(分)
+       coupon_price_format: 用券金额(元)
+       coupon_price: 用券金额(分)
        buy_price: 进货现金总价(分)
        paied_time: 支付时间
        paied_at: 支付时间(时间戳)