Sha256: 5a453cee1207700395b1f44f9427c46398b8ce72f3df8cb3a262e90b9bc1351c

Contents?: true

Size: 734 Bytes

Versions: 5

Compression:

Stored size: 734 Bytes

Contents

class EricWeixin::Cms::Weixin::Xiaodian::ProductsController < EricWeixin::Cms::BaseController
  def index
    @products = EricWeixin::Xiaodian::Product.all
    @products = @products.where("id >= ?", params[:start_id]) unless params[:start_id].blank?
    @products = @products.where("id <= ?", params[:end_id]) unless params[:end_id].blank?
    @products = @products.order(id: :desc).paginate(per_page: params[:per_page]||6, page: params[:page]||1)
  end

  def get_all_products
    EricWeixin::PublicAccount.all.each do |pb|
      EricWeixin::Xiaodian::Product.get_all_products pb.name
      EricWeixin::Xiaodian::Category.update_sku_info pb.name
    end
    redirect_to 'EricWeixin::Cms::Weixin::Xiaodian::Products#index'
  end


end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eric_weixin-0.4.2 app/controllers/eric_weixin/cms/weixin/xiaodian/products_controller.rb
eric_weixin-0.4.1 app/controllers/eric_weixin/cms/weixin/xiaodian/products_controller.rb
eric_weixin-0.4.0 app/controllers/eric_weixin/cms/weixin/xiaodian/products_controller.rb
eric_weixin-0.3.3 app/controllers/eric_weixin/cms/weixin/xiaodian/products_controller.rb
eric_weixin-0.3.2 app/controllers/eric_weixin/cms/weixin/xiaodian/products_controller.rb