Config.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com
  8. * =========================================================
  9. */
  10. namespace addon\memberregister\shop\controller;
  11. use addon\memberregister\model\Register;
  12. use app\shop\controller\BaseShop;
  13. /**
  14. * 会员注册
  15. */
  16. class Config extends BaseShop
  17. {
  18. public function index()
  19. {
  20. $config_model = new Register();
  21. if (request()->isAjax()) {
  22. $data = [
  23. 'point' => input('point', 0),//注册送积分
  24. 'balance' => input('balance', 0),//注册送余额
  25. 'growth' => input('growth', ''),//注册赠送成长值
  26. 'coupon' => input('coupon', ''),//注册送优惠券 (先不用做)
  27. ];
  28. $is_use = input("is_use", 0);//是否启用
  29. $res = $config_model->setConfig($data, $is_use, $this->site_id);
  30. $this->addLog("设置会员注册奖励");
  31. return $res;
  32. } else {
  33. //注册后奖励
  34. $config_result = $config_model->getConfig($this->site_id);
  35. $this->assign('config', $config_result[ 'data' ]);
  36. //获取优惠券(后做)
  37. return $this->fetch('config/index');
  38. }
  39. }
  40. }