From 2cb312831659c2421eb052630a05a039dbbc43ec Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 2 May 2018 16:50:28 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9where?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=A0=BC=E5=BC=8F=EF=BC=8C=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=ACtp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/api/Push.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/wechat/controller/api/Push.php b/application/wechat/controller/api/Push.php index 2a7fbae84..0ab51cd4e 100644 --- a/application/wechat/controller/api/Push.php +++ b/application/wechat/controller/api/Push.php @@ -280,7 +280,7 @@ class Push /** * 更新推荐二维码关系 - * @param string $key + * @param string $openid * @return bool * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException @@ -288,10 +288,10 @@ class Push * @throws \think\exception\DbException * @throws \think\exception\PDOException */ - protected function updateSpread($key) + protected function updateSpread($openid) { // 检测推荐是否有效 - $fans = Db::name('WechatFans')->where(['openid' => $key])->find(); + $fans = Db::name('WechatFans')->where('openid', $openid)->find(); if (empty($fans['openid']) || $fans['openid'] === $this->openid) { return false; } @@ -318,7 +318,7 @@ class Push FansService::set($userInfo); } else { $fans = ['subscribe' => '0', 'openid' => $this->openid, 'appid' => $this->appid]; - DataService::save('WechatFans', $fans, 'openid', ['appid' => $this->appid]); + DataService::save('WechatFans', $fans, 'openid', [['appid', 'eq', $this->appid]]); } }