Forráskód Böngészése

fohow 订单统计功能

abiao 5 éve
szülő
commit
119604b00e
2 módosított fájl, 6 hozzáadás és 1 törlés
  1. 5 1
      app/models/order_static.rb
  2. 1 0
      config/locales/models/order_static.yml

+ 5 - 1
app/models/order_static.rb

@@ -25,6 +25,10 @@ class OrderStatic < ActiveRecord::Base
     end
   end
 
+  def begin_date_fomate
+    return self.begin_date.strftime
+  end
+
   STATUS_ENUM = [["未支付","unpay"],["已关闭","closed"],["待确认","unconfirmed"],["处理中","processing"],["已完成","complete"],["待收货","dispatch"],["已退款","refunded"]]
   
   rails_admin do
@@ -34,7 +38,7 @@ class OrderStatic < ActiveRecord::Base
     list do
       filters [:begin_date,:end_date, :state,:is_send]
       field :id
-      field :begin_date.strftime("%Y-%m-%d")
+      field :begin_date_fomate
       field :end_date
       field :state, :enum do
           enum do

+ 1 - 0
config/locales/models/order_static.yml

@@ -5,6 +5,7 @@ zh-CN:
     attributes:
       order_static:
         begin_date: 开始时间
+        begin_date_fomate: 开始时间
         end_date: 结束时间
         state: 订单状态
         is_send: 是否赠品