Explorar o código

product package function develop--order base detail add send

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

+ 5 - 1
app/models/product_item.rb

@@ -4,6 +4,7 @@ class ProductItem < ActiveRecord::Base
   self.table_name = "product_items"
   validates :product_id,:item_id,:nums, presence: true
   validate :product_validation
+
   def product_validation
     if self.product_id > 0
       prd = Product.where("id = ?", self.product_id).first
@@ -25,7 +26,10 @@ class ProductItem < ActiveRecord::Base
         self.item_title=prd.name
       end
     end
-
+    #清空套装缓存
+    url = "#{CONFIG_FILE["api_host"]}railsadmin/clean_cache/package/#{self.product_id}"
+    p url
+    open(url)
   end
 
   rails_admin do