JuiceTest.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Bear
  5. * Date: 2020/4/22
  6. * Time: 上午11:54
  7. */
  8. use app\main\constants\CacheConstants;
  9. use \app\main\service\ToutiaoNotifyService;
  10. use app\main\model\object\UserObject;
  11. use app\main\service\UserService;
  12. class JuiceTest extends TestInit
  13. {
  14. public function testDate()
  15. {
  16. echo \app\main\helper\DateHelper::ios_8601();
  17. }
  18. public function testNotify()
  19. {
  20. $user = UserService::instance()->getUserModel()->getUserInfo(20001428);
  21. $oUser = (new UserObject())->bind($user);
  22. $clientCache = CacheConstants::getUserClientCache($oUser->id);
  23. \app\common\library\Redis::instance()->hMSet($clientCache, ['ip'=>'103.121.164.210', 'ua'=>'Mozilla/5.0 (Linux; Android 10; PCT-AL10 Build/HUAWEIPCT-AL10; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/78.0.3904.62 XWEB/2295 MMWEBSDK/200301 Mobile Safari/537.36 MMWEBID/3595 MicroMessenger/7.0.13.1640(0x27000D39) Process/tools NetType/WIFI Language/zh_CN ABI/arm64 WeChat/arm64']);
  24. $order = \app\main\service\OrderService::instance()->getOrderModel()->where('user_id', $oUser->id)->find();
  25. $oOrder = (new \app\main\model\object\OrderObject())->bind($order->getData());
  26. $adminConfig = \app\main\service\AdminService::instance()->getAdminConfigModel()->getAdminInfoAll(1734);
  27. // $type = ToutiaoNotifyService::instance()::JUICE_EVENT_TYPE_NEW;
  28. $type = ToutiaoNotifyService::instance()::ORANGE_EVENT_TYPE_PAY;
  29. ToutiaoNotifyService::instance()->OrangeNotify($adminConfig, $oUser, $type, $oOrder);
  30. }
  31. }