Explorar el Código

fohow 订单统计功能

abiao hace 5 años
padre
commit
6f56a7ca35
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      app/models/order_static.rb

+ 7 - 1
app/models/order_static.rb

@@ -3,7 +3,7 @@ class OrderStatic < ActiveRecord::Base
   has_paper_trail
   self.table_name = "order_statics"
   after_create :order_static
-  after_update :order_static
+  after_update :after_update
   after_destroy :del_static
 
   validates :begin_date,presence: true
@@ -14,6 +14,12 @@ class OrderStatic < ActiveRecord::Base
       open(url)
   end
 
+  def after_update
+    #统计订单商品销售数据
+    url = "#{CONFIG_FILE["api_host"]}/railsadmin/order/static/#{self.id}"
+    p url
+    open(url)
+  end
 
   def del_static
     # 删除商品统计数据