12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Bear
- * Date: 2020/2/13
- * Time: 上午9:19
- */
- use app\main\constants\AdminConstants;
- use app\main\constants\CacheConstants;
- use app\main\service\ToutiaoNotifyService;
- use app\main\service\UserService;
- class ToutiaoNotifyServiceTest extends TestInit
- {
- public function testConfig()
- {
- $data = ToutiaoNotifyService::instance()->getKlConfig(3, 'tout');
- var_dump($data);
- }
- public function testKl()
- {
- $config = [
- 'money'=>30,
- 'kl'=>0.2
- ];
- $data = ToutiaoNotifyService::instance()->checkKl($config['money'], $config['kl'], 50);
- var_dump($data);
- }
- public function testBack()
- {
- $userInfo = UserService::instance()->getUserModel()->getUserInfo(60063);
- $toutType = $adminConfig['callback_time_tout'] ?? AdminConstants::CALLBACK_TIME_ONCE_24;
- $check = ToutiaoNotifyService::instance()->checkCallbackTime($userInfo['subscribe_time'], $toutType)->data;
- $sToutChuanKey = CacheConstants::getCallbackLimitTout($userInfo['id']);
- echo $sToutChuanKey;
- }
- }
|