소스 검색

增加复制商品功能

abiao 5 년 전
부모
커밋
1ba0a9148a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      app/models/product.rb

+ 2 - 2
app/models/product.rb

@@ -10,14 +10,14 @@ class Product < ActiveRecord::Base
     after_update :after_update
     def after_create
         #主商品默认关联商品
-        if self.show_flag==1
+        if self.show_flag
             self.relate_product_id = self.id
             self.save
         end
     end
     def after_update
         #若取消,则用户卡次数加1
-        if self.show_flag==1
+        if self.show_flag
             self.relate_product_id = self.id
             self.save
         end