Test.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace app\admin\controller;
  3. use crmeb\services\async\LuckyCalc;
  4. use crmeb\services\async\ClearanceCalc;
  5. use crmeb\utils\Redis;
  6. use think\facade\Log;
  7. use app\api\controller\board\UserBoardController;
  8. use app\models\redis\SystemCarousel;
  9. use crmeb\services\async\task\WechatNotify;
  10. use think\facade\Config;
  11. class Test
  12. {
  13. public function index()
  14. {
  15. $redis = Redis::instance();
  16. var_dump($redis->get(['CRMEB','TESD']));
  17. }
  18. protected function test_board() {
  19. Log::warning("board updated.");
  20. $ctl = new UserBoardController();
  21. $ctl->cache_board();
  22. }
  23. protected function test_calc() {
  24. $activities = [new ClearanceCalc(), new LuckyCalc()];
  25. foreach($activities as $activity) {
  26. $activity->calc();
  27. }
  28. }
  29. protected function test_carousel() {
  30. SystemCarousel::add('good test', '/pages/leader_board/index');
  31. print_r(SystemCarousel::getFirst(20));
  32. SystemCarousel::removeTrash();
  33. }
  34. protected function test_wechat_robot() {
  35. $key = Config::get('app.qy_weixin_robot_aristotle');
  36. // $svc = \crmeb\services\QyWeixinService::instance();
  37. // $svc->key($key)->markdown("### user commented\n>hhhh\n1. upm youth\n2. shiny tommorowwww")->post();
  38. WechatNotify::push(WechatNotify::TYPE_COMMENT, $key, 'gdf');
  39. }
  40. public function test()
  41. {
  42. //$this->test_wechat_robot();
  43. }
  44. }