Selaa lähdekoodia

product package function develop--order base detail add send

abiao 4 vuotta sitten
vanhempi
commit
0df80f8466
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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