mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]微信关键字管理
This commit is contained in:
parent
d21d4fa4d1
commit
20a613dbcb
@ -50,7 +50,7 @@ function & load_wechat($type = '') {
|
||||
'ssl_key' => sysconf('wechat_cert_key'),
|
||||
'cachepath' => CACHE_PATH . 'wxpay' . DS,
|
||||
];
|
||||
$wechat[$index] = &Loader::get($type, $config);
|
||||
$wechat[$index] = Loader::get($type, $config);
|
||||
}
|
||||
return $wechat[$index];
|
||||
}
|
||||
|
@ -18,8 +18,8 @@ use service\DataService;
|
||||
use service\WechatService;
|
||||
use Wechat\WechatReceive;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Log;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 微信接口控制器
|
||||
@ -151,18 +151,18 @@ class Api extends Controller {
|
||||
protected function _event() {
|
||||
$event = $this->wechat->getRevEvent();
|
||||
switch (strtolower($event['event'])) {
|
||||
/* 关注事件 */
|
||||
/* 粉丝关注事件 */
|
||||
case 'subscribe':
|
||||
$this->_syncFans(true);
|
||||
if (!empty($event['key']) && stripos($event['key'], 'qrscene_') !== false) {
|
||||
$this->_spread(preg_replace('|^.*?(\d+).*?$|', '$1', $event['key']));
|
||||
}
|
||||
return $this->_keys('wechat_keys#keys#subscribe');
|
||||
/* 取消关注 */
|
||||
/* 粉丝取消关注 */
|
||||
case 'unsubscribe':
|
||||
$this->_syncFans(false);
|
||||
exit('success');
|
||||
/* 点击菜单 */
|
||||
/* 点击菜单事件 */
|
||||
case 'click':
|
||||
return $this->_keys($event['key']);
|
||||
/* 扫码推事件 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user