Update Fans.php

This commit is contained in:
Anyon 2019-07-31 18:48:06 +08:00
parent b3a78e680f
commit 146bbe6a04

View File

@ -102,7 +102,7 @@ class Fans extends Controller
try { try {
foreach (array_chunk(explode(',', $this->request->post('openid')), 20) as $openids) { foreach (array_chunk(explode(',', $this->request->post('openid')), 20) as $openids) {
WechatService::WeChatUser($this->appid)->batchBlackList($openids); WechatService::WeChatUser($this->appid)->batchBlackList($openids);
Db::name('WechatFans')->whereIn('openid', $openids)->update(['is_black' => '1']); Db::name('WechatFans')->where(['appid' => $this->appid])->whereIn('openid', $openids)->update(['is_black' => '1']);
} }
$this->success('拉黑粉丝信息成功!'); $this->success('拉黑粉丝信息成功!');
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {
@ -122,7 +122,7 @@ class Fans extends Controller
$this->applyCsrfToken(); $this->applyCsrfToken();
foreach (array_chunk(explode(',', $this->request->post('openid')), 20) as $openids) { foreach (array_chunk(explode(',', $this->request->post('openid')), 20) as $openids) {
WechatService::WeChatUser($this->appid)->batchUnblackList($openids); WechatService::WeChatUser($this->appid)->batchUnblackList($openids);
Db::name('WechatFans')->whereIn('openid', $openids)->update(['is_black' => '0']); Db::name('WechatFans')->where(['appid' => $this->appid])->whereIn('openid', $openids)->update(['is_black' => '0']);
} }
$this->success('取消拉黑粉丝信息成功!'); $this->success('取消拉黑粉丝信息成功!');
} catch (HttpResponseException $exception) { } catch (HttpResponseException $exception) {