浏览代码

增加微信粉丝处理

Anyon 5 年之前
父节点
当前提交
c178b9d2da
共有 2 个文件被更改,包括 29 次插入0 次删除
  1. 12 0
      app/wechat/command/WechatFans.php
  2. 17 0
      app/wechat/controller/Fans.php

+ 12 - 0
app/wechat/command/WechatFans.php

@@ -0,0 +1,12 @@
+<?php
+
+
+namespace app\wechat\command;
+
+use think\console\Command;
+
+class WechatFans extends Command
+{
+    // @todo 待完成指令 
+
+}

+ 17 - 0
app/wechat/controller/Fans.php

@@ -65,6 +65,23 @@ class Fans extends Controller
     }
 
     /**
+     * 同步粉丝数据
+     * @auth true
+     */
+    public function sync()
+    {
+        try {
+            $appid = WechatService::instance()->getAppid();
+            sysqueue('同步粉丝数据', "xsync:fans {$appid} -", 1, [], 0);
+            $this->success('创建任务成功,请等待完成!');
+        } catch (HttpResponseException $exception) {
+            throw $exception;
+        } catch (\Exception $exception) {
+            $this->error("创建任务失败,{$exception->getMessage()}");
+        }
+    }
+
+    /**
      * 批量拉黑粉丝
      * @auth true
      */