ToutiaoNotifyServiceTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Bear
  5. * Date: 2020/2/13
  6. * Time: 上午9:19
  7. */
  8. use app\main\constants\AdminConstants;
  9. use app\main\constants\CacheConstants;
  10. use app\main\service\ToutiaoNotifyService;
  11. use app\main\service\UserService;
  12. class ToutiaoNotifyServiceTest extends TestInit
  13. {
  14. public function testConfig()
  15. {
  16. $data = ToutiaoNotifyService::instance()->getKlConfig(3, 'tout');
  17. var_dump($data);
  18. }
  19. public function testKl()
  20. {
  21. $config = [
  22. 'money'=>30,
  23. 'kl'=>0.2
  24. ];
  25. $data = ToutiaoNotifyService::instance()->checkKl($config['money'], $config['kl'], 50);
  26. var_dump($data);
  27. }
  28. public function testBack()
  29. {
  30. $userInfo = UserService::instance()->getUserModel()->getUserInfo(60063);
  31. $toutType = $adminConfig['callback_time_tout'] ?? AdminConstants::CALLBACK_TIME_ONCE_24;
  32. $check = ToutiaoNotifyService::instance()->checkCallbackTime($userInfo['subscribe_time'], $toutType)->data;
  33. $sToutChuanKey = CacheConstants::getCallbackLimitTout($userInfo['id']);
  34. echo $sToutChuanKey;
  35. }
  36. }