MemberAccountRule.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace addon\memberregister\event;
  11. use addon\memberregister\model\Register;
  12. /**
  13. * 会员账户变化规则
  14. */
  15. class MemberAccountRule
  16. {
  17. public function handle($data)
  18. {
  19. $config = new Register();
  20. $info = $config->getConfig($data['site_id']);
  21. $return = '';
  22. if ($data['account'] == 'point') {
  23. if ($info['data']['is_use'] == 1) {
  24. $return .= "会员注册,赠送" . $info['data']['value']['point'] . "积分";
  25. }
  26. }
  27. if ($data['account'] == 'growth') {
  28. if ($info['data']['is_use'] == 1) {
  29. $return .= "会员注册,赠送" . $info['data']['value']['growth'] . "成长值";
  30. }
  31. }
  32. if ($data['account'] == 'balance') {
  33. if ($info['data']['is_use'] == 1) {
  34. $return .= "会员注册,赠送" . $info['data']['value']['balance'] . "元余额红包";
  35. }
  36. }
  37. return isset($return) ? $return : '';
  38. }
  39. }