<% EricWeixin::PublicAccount.all.each do |pa| %> <%= link_to "快速更新#{pa.name}微信用户信息", "/eric_weixin/cms/weixin/weixin_users/quick_get_user_infos?public_account_id=#{pa.id}", class: 'button tiny' %> <% end %>
<% EricWeixin::PublicAccount.all.each do |pa| %> <%= link_to "批量更新#{pa.name}微信用户信息", "/eric_weixin/cms/weixin/weixin_users/batch_update_user_infos?public_account_id=#{pa.id}", class: 'button tiny' %> <% end %>

用户表

<%= form_tag '/eric_weixin/cms/weixin/weixin_users', method: :get do %>
<%= select_tag :subscribe, options_from_collection_for_select({1=>'订阅',0=>'取消订阅'},'first','second',params[:subscribe]),prompt:"ALL" %>
<%= text_field_tag :nickname, params[:nickname] ,placeholder:"ALL" %>
<%= select_tag :sex, options_from_collection_for_select(::EricWeixin::WeixinUser::SEX,'first','second',params[:sex]), prompt:"ALL" %>
<%= text_field_tag :city, params[:city] ,placeholder:"ALL" %>
<%= text_field_tag :province, params[:province] ,placeholder:"ALL" %>
<%= text_field_tag :first_register_channel, params[:first_register_channel], placeholder: "ALL" %>
<%= text_field_tag :last_register_channel, params[:last_register_channel], placeholder: "ALL" %>
<%= date_field_tag :start_date, params[:start_date] %>
<%= date_field_tag :end_date, params[:end_date] %>
<%= select_tag :public_account_id, options_from_collection_for_select(@public_accounts, 'id', 'name', (params[:public_account_id].blank? ? 1 : params[:public_account_id])), prompt: '请选择公众账号' %>
<%= submit_tag '加载用户', class: 'button tiny' %>
<% end %> <% unless @weixin_users.blank? %> <%= will_paginate @collection, renderer: FoundationPagination::Rails %> <% @weixin_users.each do |user| %> <% end %>
openid 是否订阅 昵称 性别 国家 | 省份 | 城市 头像 关注时间 备注 最后一次注册渠道 第一次注册渠道操作
<%= user.openid %> <%= case user.subscribe when 1 then '是' when 0 then '否' end %> <%= user.nickname %> <%= case user.sex when 1 then '男' when 2 then '女' else '未知' end %> <%= user.country %>
<%= user.province %>
<%= user.city %>
<%= image_tag(user.headimgurl, height: '32', width: '32') %> <%= Time.at(user.subscribe_time.to_i).strftime('%Y-%m-%d %H:%M') %> <%= user.remark %> <%= user.translate_register_channel "last_register_channel" %> <%= user.translate_register_channel "first_register_channel" %> <%= link_to '备注', "javascript:open_modal(#{user.id})" %>
<%= will_paginate @collection, renderer: FoundationPagination::Rails %> <% end %> <%= hidden_field_tag :hidden_user_id %>