UcCacheConstants.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * Created by: PhpStorm
  4. * User: lytian
  5. * Date: 2020/3/16
  6. * Time: 14:21
  7. */
  8. namespace app\main\constants;
  9. use app\main\service\ToutiaoNotifyService;
  10. class UcCacheConstants
  11. {
  12. /**
  13. * 支付缓存
  14. * @param $user_id
  15. * @return string
  16. */
  17. public static function getGuideWxPay($user_id)
  18. {
  19. return 'UCGWSPAY:' . $user_id;
  20. }
  21. /**
  22. * 头条引导微信关注
  23. * @param $ip
  24. * @param $ua
  25. * @return string
  26. */
  27. public static function getGuideWxSubscribe($ip, $ua)
  28. {
  29. $ua = ToutiaoNotifyService::instance()->getUaInfo($ua)->data;
  30. return 'UCGWS:' . $ip . ':' . $ua;
  31. }
  32. /**
  33. * 头条落地页渠道配置信息
  34. * @param $channel_id
  35. * @return string
  36. */
  37. public static function getGuideWxSetting($channel_id)
  38. {
  39. return 'UCGWSS:' . $channel_id;
  40. }
  41. /**
  42. * 支付次数累计
  43. * @param $id
  44. * @return string
  45. */
  46. public static function getGuideWxPayCount($id)
  47. {
  48. return 'UCGWSPC:' . $id;
  49. }
  50. /**
  51. * 支付次数累计
  52. * @param $id
  53. * @return string
  54. */
  55. public static function getGuideWxPayMoney($id)
  56. {
  57. return 'UCGWSPM:' . $id;
  58. }
  59. /**
  60. * 新增获客
  61. * @param $id
  62. * @return string
  63. */
  64. public static function getGuideWxNewCount($id)
  65. {
  66. return 'UCGWSNC:' . $id;
  67. }
  68. /**
  69. * 支付次数累计
  70. * @param $id
  71. * @return string
  72. */
  73. public static function getGuideWxDayPayCount($id)
  74. {
  75. return 'UCGWSPC:' .date('d'). $id;
  76. }
  77. /**
  78. * 支付次数累计
  79. * @param $id
  80. * @return string
  81. */
  82. public static function getGuideWxDayPayMoney($id)
  83. {
  84. return 'UCGWSPM:' .date('d'). $id;
  85. }
  86. /**
  87. * 新增当日获客
  88. * @param $id
  89. * @return string
  90. */
  91. public static function getGuideWxDayNewCount($id)
  92. {
  93. return 'UCGWSNC:' .date('d'). $id;
  94. }
  95. }