CustomConstants.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Bear
  5. * Date: 2018/11/29
  6. * Time: 下午5:44
  7. */
  8. namespace app\main\constants;
  9. class CustomConstants
  10. {
  11. //客服消息图文Mark
  12. const MARK_CUSTOM_IMG = 3201;
  13. //客服消息文字Mark
  14. const MARK_CUSTOM_TEXT = 3202;
  15. /**
  16. * 获取客服消息累计UV
  17. * @param $custom_id
  18. * @param $custom_idx
  19. * @return string
  20. */
  21. public static function getCustomUvKey($custom_id,$custom_idx){
  22. return "CU_UV:{$custom_id}:{$custom_idx}";
  23. }
  24. /**
  25. * 获取客服消息当天UV
  26. * @param $custom_id
  27. * @param $custom_idx
  28. * @param $time
  29. * @return string
  30. */
  31. public static function getCustomUvToDayKey($custom_id,$custom_idx,$time = null){
  32. $date_time = $time ? date('Ymd',$time) : date('Ymd');
  33. return "CU_UV_T:{$date_time}:{$custom_id}:{$custom_idx}";
  34. }
  35. /**
  36. * 获取客服消息当天Money
  37. * @param $custom_id
  38. * @param $custom_idx
  39. * @param $time
  40. * @return string
  41. */
  42. public static function getCustomRechargeMoneyToDayKey($custom_id,$custom_idx,$time = null){
  43. $date_time = $time ? date('Ymd',$time) : date('Ymd');
  44. return "CU_MONEY_T:{$date_time}:{$custom_id}:{$custom_idx}";
  45. }
  46. }