截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\common\enum;
  20. /**
  21. * Class NoticeEnum
  22. * @package app\common\enum
  23. */
  24. class NoticeEnum
  25. {
  26. //通知类型
  27. const SYSTEM_NOTICE = 1; //系统通知
  28. const SMS_NOTICE = 2; //短信通知
  29. const OA_NOTICE = 3; //公众号模板通知
  30. const MNP_NOTICE = 4; //小程序订阅消息通知
  31. //通知对象
  32. const NOTICE_USER = 1; //通知会员
  33. const NOTICE_SHOP = 2; //通知商家
  34. const NOTICE_PLATFORM = 3; //通知平台
  35. const NOTICE_OTHER = 4; //通知游客(如新用户注册)
  36. //*************************************************通知会员********************************************************
  37. //通知会员-短信验证码
  38. const REGISTER_NOTICE = 100; //注册会员短信验证码通知
  39. const CHANGE_MOBILE_NOTICE = 101; //变更手机短信验证码通知
  40. const GET_BACK_MOBILE_NOTICE = 102; //找回密码短信验证码通知
  41. const GET_GODE_LOGIN_NOTICE = 110; //验证码登录
  42. const BIND_MOBILE_NOTICE = 111; //绑定手机号
  43. const GET_BACK_PAY_CODE_NOTICE = 112; //找回支付密码
  44. //通知会员-订单相关
  45. const ORDER_PAY_NOTICE = 103; //成功下单通知
  46. const ORDER_DELIVERY_NOTICE = 104; //订单发货通知
  47. const AFTER_SALE_NOTICE = 105; //售后退款申请状态通知
  48. //通知会员-佣金相关
  49. const GET_FUTURE_EARNINGS_NOTICE = 107; //获得预估推广佣金通知
  50. const GET_EARNINGS_NOTICE = 113; //推广佣金到账通知
  51. //通知会员-其他
  52. const INVITE_SUCCESS_NOTICE = 106; //成功邀请粉丝通知
  53. const SHOP_APPLY_ERROR_NOTICE = 108; //商家入驻申请失败通知
  54. const SHOP_APPLY_SUCCESS_NOTICE = 109; //商家入驻申请成功通知
  55. const SHOP_APPLY_CHECK_CODE = 114; //商家入驻手机短信验证通知
  56. //**************************************************************************************************************
  57. //*************************************************通知商家和平台********************************************************
  58. //通知商家
  59. const USER_PAID_NOTICE_SHOP = 200;//会员支付下单通知商家
  60. const AFTER_SALE_NOTICE_SHOP = 201;//会员发起售后退款通知商家
  61. //通知平台
  62. const SHOP_APPLY_NOTICE_PLATFORM = 300; //商家入驻通知
  63. const SHOP_WITHDRAWAL_NOTICE_PLATFORM = 301; //商家提现通知
  64. //*************************************************通知会员********************************************************
  65. //通知平台的场景
  66. const NOTICE_PLATFORM_SCENE = [
  67. self::SHOP_APPLY_NOTICE_PLATFORM,
  68. self::SHOP_WITHDRAWAL_NOTICE_PLATFORM,
  69. ];
  70. //通知商家的场景
  71. const NOTICE_SHOP_SCENE = [
  72. self::USER_PAID_NOTICE_SHOP,
  73. self::AFTER_SALE_NOTICE_SHOP,
  74. ];
  75. //通知会员的场景
  76. const NOTICE_USER_SCENE = [
  77. self::CHANGE_MOBILE_NOTICE,
  78. self::GET_BACK_MOBILE_NOTICE,
  79. self::ORDER_PAY_NOTICE,
  80. self::ORDER_DELIVERY_NOTICE,
  81. self::AFTER_SALE_NOTICE,
  82. self::INVITE_SUCCESS_NOTICE,
  83. self::GET_FUTURE_EARNINGS_NOTICE,
  84. self::GET_EARNINGS_NOTICE,
  85. self::SHOP_APPLY_ERROR_NOTICE,
  86. self::SHOP_APPLY_SUCCESS_NOTICE,
  87. self::GET_GODE_LOGIN_NOTICE,
  88. self::BIND_MOBILE_NOTICE,
  89. self::GET_BACK_PAY_CODE_NOTICE,
  90. self::SHOP_APPLY_CHECK_CODE,
  91. ];
  92. //通知游客(还不存在当前系统的人)
  93. const NOTICE_OTHER_SCENE = [
  94. self::REGISTER_NOTICE
  95. ];
  96. //订单相关场景
  97. const ORDER_SCENE = [
  98. self::ORDER_PAY_NOTICE,
  99. self::ORDER_DELIVERY_NOTICE,
  100. self::AFTER_SALE_NOTICE,
  101. ];
  102. //验证码的场景
  103. const NOTICE_NEED_CODE = [
  104. self::REGISTER_NOTICE,
  105. self::CHANGE_MOBILE_NOTICE,
  106. self::GET_BACK_MOBILE_NOTICE,
  107. self::GET_GODE_LOGIN_NOTICE,
  108. self::BIND_MOBILE_NOTICE,
  109. self::GET_BACK_PAY_CODE_NOTICE,
  110. self::SHOP_APPLY_CHECK_CODE,
  111. ];
  112. //场景值-短信场景
  113. const SMS_SCENE = [
  114. 'DDZFTZ' => self::ORDER_PAY_NOTICE, //订单支付通知
  115. 'DDFHTZ' => self::ORDER_DELIVERY_NOTICE, //订单发货通知
  116. 'ZCYZ' => self::REGISTER_NOTICE, //注册验证
  117. 'ZHMM' => self::GET_BACK_MOBILE_NOTICE, //找回密码
  118. 'YZMDL' => self::GET_GODE_LOGIN_NOTICE, //验证码登录
  119. 'BGSJHM' => self::CHANGE_MOBILE_NOTICE, //变更手机号码
  120. 'BDSJHM' => self::BIND_MOBILE_NOTICE, //绑定手机号码
  121. 'ZHZFMM' => self::GET_BACK_PAY_CODE_NOTICE, // 找回支付密码
  122. 'SJRZSB' => self::SHOP_APPLY_ERROR_NOTICE, //商家入驻失败
  123. 'SJRZCG' => self::SHOP_APPLY_SUCCESS_NOTICE, //商家入驻成功
  124. 'SJSQYZ' => self::SHOP_APPLY_CHECK_CODE,//商家入驻申请验证码验证
  125. 'DDTZSJ' => self::USER_PAID_NOTICE_SHOP,//下单通知商家
  126. 'SHTZSJ' => self::AFTER_SALE_NOTICE_SHOP,//售后通知商家
  127. 'SJSQTZPT' => self::SHOP_APPLY_NOTICE_PLATFORM, //商家申请通知平台
  128. 'SJTXTZPT' => self::SHOP_WITHDRAWAL_NOTICE_PLATFORM, //商家提现通知平台
  129. ];
  130. /**
  131. * Notes: 通知描述
  132. * @param $state
  133. * @author 段誉(2021/6/4 15:14)
  134. * @return array|mixed|string
  135. */
  136. public static function getSceneDesc($state)
  137. {
  138. $data = [
  139. //会员-短信验证码
  140. self::REGISTER_NOTICE => '注册会员短信验证码通知',
  141. self::CHANGE_MOBILE_NOTICE => '变更手机短信验证码通知',
  142. self::GET_BACK_MOBILE_NOTICE => '找回登录密码短信验证码通知',
  143. self::GET_GODE_LOGIN_NOTICE => '手机短信验证码登录通知',
  144. self::BIND_MOBILE_NOTICE => '手机绑定短信验证码验证通知',
  145. self::GET_BACK_PAY_CODE_NOTICE => '找回支付密码短信验证码通知',
  146. //会员-订单相关通知
  147. self::ORDER_PAY_NOTICE => '成功下单通知',
  148. self::ORDER_DELIVERY_NOTICE => '订单发货通知',
  149. self::AFTER_SALE_NOTICE => '售后退款申请状态通知',
  150. //会员-佣金相关通知
  151. self::GET_FUTURE_EARNINGS_NOTICE => '获得预估推广佣金通知',
  152. self::GET_EARNINGS_NOTICE => '推广佣金到账通知',
  153. //会员-其他通知
  154. self::INVITE_SUCCESS_NOTICE => '成功邀请粉丝通知',
  155. self::SHOP_APPLY_ERROR_NOTICE => '商家入驻申请失败通知',
  156. self::SHOP_APPLY_SUCCESS_NOTICE => '商家入驻申请成功通知',
  157. self::SHOP_APPLY_CHECK_CODE => '商家入驻手机短信验证通知',
  158. //平台
  159. self::SHOP_APPLY_NOTICE_PLATFORM => '商家入驻通知',
  160. self::SHOP_WITHDRAWAL_NOTICE_PLATFORM => '商家提现通知',
  161. //商家
  162. self::USER_PAID_NOTICE_SHOP => '订单通知',
  163. self::AFTER_SALE_NOTICE_SHOP => '售后退款申请通知',
  164. ];
  165. if ($state === true) {
  166. return $data;
  167. }
  168. return $data[$state] ?? '';
  169. }
  170. }