# encoding:utf-8
class AdItemClickStatistic < ActiveRecord::Base
  has_paper_trail
  self.table_name = "ad_item_click_statistics"
  validates_presence_of :ad_item_id, :wx_uid, :click_times

  belongs_to :wx_user, :foreign_key => :wx_uid
  belongs_to :ad_item, :foreign_key => :ad_item_id

  rails_admin do
    navigation_label '广告渠道管理'
    weight -500
    parent AdPosition

    list do
      filters [:id, :wx_user, :ad_item]
      field :id
      field :ad_item_id
      field :ad_item
      field :wx_uid
      field :wx_user
      field :ip
      field :click_times
      field :click_last_time
      field :created_at
      field :updated_at
    end

    show do
      field :id
      field :ad_item_id
      field :ad_item
      field :wx_uid
      field :wx_user
      field :ip
      field :click_times
      field :click_last_time
      field :created_at
      field :updated_at
    end

    edit do
      # field :ad_item_id
      field :ad_item
      field :wx_uid
      field :ip
      field :click_times
      field :click_last_time
    end
  end
end