product_warn.rb 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # encoding: utf-8
  2. class ProductWarn < ActiveRecord::Base
  3. has_paper_trail
  4. self.table_name = "product_warns"
  5. validates :happen_time,:product_id,:sale_90,presence: true
  6. rails_admin do
  7. navigation_label '商品管理'
  8. parent Product
  9. weight -500
  10. list do
  11. filters [:happen_time,:product_id]
  12. field :id
  13. field :happen_time
  14. field :product_id
  15. field :product_name
  16. field :product_type
  17. field :product_size
  18. field :sale_90
  19. field :sale_30
  20. field :sale_10
  21. field :now_count
  22. field :product_cycle
  23. field :stock_cycle
  24. field :min_purchase
  25. field :history_day_sales
  26. field :recommend_count
  27. #field :created_at
  28. # field :updated_at
  29. end
  30. show do
  31. field :id
  32. field :happen_time
  33. field :product_id
  34. field :product_name
  35. field :product_type
  36. field :product_size
  37. field :sale_90
  38. field :sale_30
  39. field :sale_10
  40. field :now_count
  41. field :product_cycle
  42. field :stock_cycle
  43. field :min_purchase
  44. field :history_day_sales
  45. field :recommend_count
  46. # field :created_at
  47. # field :updated_at
  48. end
  49. edit do
  50. field :happen_time
  51. field :product_id
  52. field :product_name
  53. field :sale_90
  54. field :sale_30
  55. field :sale_10
  56. field :now_count
  57. field :product_cycle
  58. field :stock_cycle
  59. field :min_purchase
  60. field :history_day_sales
  61. field :recommend_count
  62. end
  63. end
  64. end