Class: EricWeixin::Cms::Weixin::WeixinUsersController
- Inherits:
-
BaseController
- Object
- BaseController
- EricWeixin::Cms::Weixin::WeixinUsersController
- Defined in:
- app/controllers/eric_weixin/cms/weixin/weixin_users_controller.rb
Instance Method Summary collapse
- #batch_update_user_infos ⇒ Object
- #index ⇒ Object
- #modify_remark ⇒ Object
- #quick_get_user_infos ⇒ Object
Instance Method Details
#batch_update_user_infos ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'app/controllers/eric_weixin/cms/weixin/weixin_users_controller.rb', line 38 def batch_update_user_infos public_account = ::EricWeixin::PublicAccount.find(params[:public_account_id]) if public_account.blank? flash[:alert] = '未指定公众账号' redirect_to action: :index return end public_account.delay(:priority => 10).update_users flash[:success] = '已经把批量更新微信用户信息任务添加到队列任务中' redirect_to action: :index end |
#index ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/eric_weixin/cms/weixin/weixin_users_controller.rb', line 2 def index @public_accounts = ::EricWeixin::PublicAccount.all public_account = ::EricWeixin::PublicAccount.find_by_id(params[:public_account_id]) @weixin_users = public_account.weixin_users.custom_query(params.permit(:subscribe, :nickname, :sex, :city, :province, :weixin_public_account_id, :start_date, :end_date, :first_register_channel, :last_register_channel)). order(id: :desc). paginate(page: params[:page]||1, per_page: params[:per_page]||10) unless public_account.blank? end |
#modify_remark ⇒ Object
19 20 21 22 23 24 |
# File 'app/controllers/eric_weixin/cms/weixin/weixin_users_controller.rb', line 19 def modify_remark user = ::EricWeixin::WeixinUser.find(params[:id]) user.set_remark params[:new_remark] user.reload render text: user.remark end |
#quick_get_user_infos ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'app/controllers/eric_weixin/cms/weixin/weixin_users_controller.rb', line 26 def quick_get_user_infos public_account = ::EricWeixin::PublicAccount.find(params[:public_account_id]) if public_account.blank? flash[:alert] = '未指定公众账号' redirect_to action: :index return end public_account.delay(:priority => 10).rebuild_users_simple flash[:success] = '已经把快速更新微信用户信息任务添加到队列任务中' redirect_to action: :index end |