TemplateMsgConstants.php 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Bear
  5. * Date: 2019/3/29
  6. * Time: 下午4:59
  7. */
  8. namespace app\main\constants;
  9. class TemplateMsgConstants
  10. {
  11. /**
  12. * 获取模板消息累计UV
  13. * @param $template_id
  14. * @return string
  15. */
  16. public static function getTemplateUvKey($template_id){
  17. return "TP_UV:{$template_id}";
  18. }
  19. /**
  20. * 获取模板消息当天UV
  21. * @param $template_id
  22. * @param $time
  23. * @return string
  24. */
  25. public static function getTemplateUvToDayKey($template_id,$time = null){
  26. $date_time = $time ? date('Ymd',$time) : date('Ymd');
  27. return "TP_UV_T:{$date_time}:{$template_id}";
  28. }
  29. /**
  30. * 获取模板消息当天Money
  31. * @param $template_id
  32. * @param $time
  33. * @return string
  34. */
  35. public static function getTemplateRechargeMoneyToDayKey($template_id,$time = null){
  36. $date_time = $time ? date('Ymd',$time) : date('Ymd');
  37. return "TP_MONEY_T:{$date_time}:{$template_id}";
  38. }
  39. }