Explorar o código

充值订单取当前时间时间戳

abiao %!s(int64=5) %!d(string=hai) anos
pai
achega
d044c849de
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      app/models/balance_order.rb

+ 5 - 1
app/models/balance_order.rb

@@ -5,7 +5,11 @@ class BalanceOrder < ActiveRecord::Base
   belongs_to :user
   belongs_to :wx_user
   validates :order_id,:user_id,:total_price,presence: true
-
+  after_create :update_paied_time
+  def update_paied_time
+    self.paied_at = Time.now.to_i
+    self.save
+  end
   PAY_WAY_ENUM = [
     ["Web网银连连支付","webbankllpay"],
     ["Web认证连连支付","webauthllpay"],