From 2d77206d5e93b081e6736ddbeb359ae84b6818e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 13 Apr 2017 15:27:47 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E7=B2=89=E4=B8=9D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/Fans.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/application/wechat/controller/Fans.php b/application/wechat/controller/Fans.php index 430ea2f6a..f105cc597 100644 --- a/application/wechat/controller/Fans.php +++ b/application/wechat/controller/Fans.php @@ -15,6 +15,7 @@ namespace app\wechat\controller; use controller\BasicAdmin; +use service\WechatService; use think\Db; /** @@ -26,8 +27,16 @@ use think\Db; */ class Fans extends BasicAdmin { + /** + * 定义当前默认数据表 + * @var string + */ protected $table='WechatFans'; + /** + * 显示粉丝列表 + * @return array|string + */ public function index() { $this->title='微信粉丝管理'; $db = Db::name($this->table); @@ -38,4 +47,15 @@ class Fans extends BasicAdmin { return parent::_list($db); } + /** + * 同步粉丝列表 + */ + public function sync(){ + if(WechatService::syncAllFans('')){ + $this->success('同步获取所有粉丝成功!',''); + }else{ + $this->error('同步获取粉丝失败,请稍候再试!'); + } + } + }