appid = input('appid', $this->app->session->get('current_appid')); if (empty($this->appid)) { $this->where = ['status' => '1', 'service_type' => '2', 'is_deleted' => '0', 'verify_type' => '0']; $this->appid = $this->app->db->name('WechatServiceConfig')->where($this->where)->value('authorizer_appid'); } if (empty($this->appid)) { $this->fetch('/not-auth'); } else { $this->app->session->set('current_appid', $this->appid); } if ($this->request->isGet()) { $this->where = ['status' => '1', 'service_type' => '2', 'is_deleted' => '0', 'verify_type' => '0']; $this->wechats = $this->app->db->name('WechatServiceConfig')->where($this->where)->order('id desc')->column('authorizer_appid,nick_name'); } } /** * 微信粉丝管理 * @auth true * @menu true */ public function index() { $this->title = '微信粉丝管理'; $query = $this->_query($this->table)->like('nickname')->equal('subscribe,is_black'); $query->dateBetween('subscribe_at')->where(['appid' => $this->appid])->order('subscribe_time desc')->page(); } /** * 列表数据处理 * @param array $data */ protected function _index_page_filter(array &$data) { $tags = $this->app->db->name('WechatFansTags')->column('id,name'); foreach ($data as &$user) { $user['tags'] = []; foreach (explode(',', $user['tagid_list']) as $tagid) { if (isset($tags[$tagid])) $user['tags'][] = $tags[$tagid]; } } } /** * 删除粉丝信息 * @auth true * @throws \think\db\exception\DbException */ public function remove() { $this->_applyFormToken(); $this->_delete($this->table); } }