Config.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | framework
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://framework.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | github开源项目:https://github.com/zoujingli/framework
  12. // +----------------------------------------------------------------------
  13. namespace app\store\controller;
  14. use app\store\service\ExtendService;
  15. use library\Controller;
  16. /**
  17. * 商城参数配置
  18. * Class Config
  19. * @package app\store\controller
  20. */
  21. class Config extends Controller
  22. {
  23. /**
  24. * 商城参数配置
  25. * @throws \think\Exception
  26. * @throws \think\exception\PDOException
  27. */
  28. public function index()
  29. {
  30. $this->applyCsrfToken();
  31. $this->title = '商城参数配置';
  32. if ($this->request->isGet()) {
  33. $this->query = ExtendService::querySmsBalance();
  34. $this->fetch();
  35. } else {
  36. foreach ($this->request->post() as $k => $v) sysconf($k, $v);
  37. $this->success('商城参数配置保存成功!');
  38. }
  39. }
  40. /**
  41. * 商城短信配置
  42. * @throws \think\Exception
  43. * @throws \think\exception\PDOException
  44. */
  45. public function sms()
  46. {
  47. $this->applyCsrfToken();
  48. $this->title = '商城短信配置';
  49. if ($this->request->isGet()) {
  50. $this->query = ExtendService::querySmsBalance();
  51. $this->fetch();
  52. } else {
  53. foreach ($this->request->post() as $k => $v) sysconf($k, $v);
  54. $this->success('商城短信配置保存成功!');
  55. }
  56. }
  57. }