From 1ae537afa6df22f23ad1105f6ca66a602f227e81 Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 31 Jul 2019 13:57:21 +0800 Subject: [PATCH] Update Index.php --- application/wechat/controller/Index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/application/wechat/controller/Index.php b/application/wechat/controller/Index.php index 8153e39e3..64c7aa722 100644 --- a/application/wechat/controller/Index.php +++ b/application/wechat/controller/Index.php @@ -15,6 +15,7 @@ namespace app\wechat\controller; +use app\wechat\service\WechatService; use library\Controller; use think\Db; @@ -29,9 +30,11 @@ class Index extends Controller * 微信数据统计 * @auth true * @menu true + * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException + * @throws \think\exception\PDOException */ public function index() { @@ -46,8 +49,9 @@ class Index extends Controller $this->totalJson['ys']['_0'][] = $item['_0']; $this->totalJson['ys']['_1'][] = $item['_1']; } - $this->totalFans = Db::name('WechatFans')->where(['is_black' => '0'])->count(); - $this->totalBlack = Db::name('WechatFans')->where(['is_black' => '1'])->count(); + $map = ['appid' => WechatService::getAppid()]; + $this->totalFans = Db::name('WechatFans')->where(['is_black' => '0'])->where($map)->count(); + $this->totalBlack = Db::name('WechatFans')->where(['is_black' => '1'])->where($map)->count(); $this->totalNews = Db::name('WechatNews')->where(['is_deleted' => '0'])->count(); $this->totalRule = Db::name('WechatKeys')->count(); $this->fetch();