|
|
@@ -115,15 +115,19 @@ class Product < ActiveRecord::Base
|
|
|
def after_destroy
|
|
|
clean_share_img
|
|
|
end
|
|
|
-
|
|
|
+ strs=""
|
|
|
def gross_interest_rate
|
|
|
rate = 0
|
|
|
if self.buy_price != 0 && self.price != 0
|
|
|
rate = (( self.price.to_f - self.buy_price.to_f )/self.buy_price.to_f)*100
|
|
|
end
|
|
|
- value = bindings[:view].current_admin_user.id
|
|
|
- #return ((rate*100).round.to_f/100).to_s + "%"
|
|
|
- return value
|
|
|
+ field :gross_interest_rate do
|
|
|
+ pretty_value{bindings[:view].current_admin_user.email}
|
|
|
+ if strs.length==0
|
|
|
+ strs=pretty_value{bindings[:view].current_admin_user.email}
|
|
|
+ end
|
|
|
+ end
|
|
|
+ return strs
|
|
|
end
|
|
|
|
|
|
rails_admin do
|