[更新]修改where条件格式,兼容新版本tp

This commit is contained in:
Anyon 2018-05-02 16:50:28 +08:00
parent 4a9e53831f
commit 2cb3128316

View File

@ -280,7 +280,7 @@ class Push
/** /**
* 更新推荐二维码关系 * 更新推荐二维码关系
* @param string $key * @param string $openid
* @return bool * @return bool
* @throws \think\Exception * @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
@ -288,10 +288,10 @@ class Push
* @throws \think\exception\DbException * @throws \think\exception\DbException
* @throws \think\exception\PDOException * @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) { if (empty($fans['openid']) || $fans['openid'] === $this->openid) {
return false; return false;
} }
@ -318,7 +318,7 @@ class Push
FansService::set($userInfo); FansService::set($userInfo);
} else { } else {
$fans = ['subscribe' => '0', 'openid' => $this->openid, 'appid' => $this->appid]; $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]]);
} }
} }