SyncUsersCommand.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * @filename GetModuleTrait.php
  4. * @createdAt 2020/2/24
  5. * @project https://github.com/yanwenwu/catch-admin
  6. * @document http://doc.catchadmin.com
  7. * @author JaguarJack <njphper@gmail.com>
  8. * @copyright By CatchAdmin
  9. * @license https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt
  10. */
  11. namespace catchAdmin\wechat\command;
  12. use catchAdmin\wechat\library\SyncWechatUsers;
  13. use catchAdmin\wechat\model\WechatUsers;
  14. use catcher\exceptions\FailedException;
  15. use catcher\facade\Trie;
  16. use catcher\library\ProgressBar;
  17. use catcher\library\WeChat;
  18. use catcher\Utils;
  19. use think\Collection;
  20. use think\console\Command;
  21. use think\console\Input;
  22. use think\console\Output;
  23. use think\Db;
  24. class SyncUsersCommand extends Command
  25. {
  26. protected $officialAccount;
  27. public function configure()
  28. {
  29. $this->setName('sync:users')
  30. ->setDescription('sync wechat users');
  31. }
  32. /**
  33. *
  34. * @time 2020年07月19日
  35. * @param Input $input
  36. * @param Output $output
  37. * @return int|void|null
  38. */
  39. public function execute(Input $input, Output $output)
  40. {
  41. (new SyncWechatUsers())->start();
  42. }
  43. }