Official.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkAdmin
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2019 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://demo.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | gitee 代码仓库:https://gitee.com/zoujingli/ThinkAdmin
  12. // | github 代码仓库:https://github.com/zoujingli/ThinkAdmin
  13. // +----------------------------------------------------------------------
  14. namespace app\admin\controller;
  15. use app\common\model\UserLevel;
  16. use app\common\service\ExtendService;
  17. use library\Controller;
  18. use app\common\service\UserSynth;
  19. /**
  20. * 参数配置
  21. * Class Official
  22. * @package app\admin\controller
  23. */
  24. class Official extends Controller
  25. {
  26. /**
  27. * 参数配置
  28. * @auth true
  29. * @menu true
  30. * @throws \think\Exception
  31. * @throws \think\exception\PDOException
  32. */
  33. public function index()
  34. {
  35. $this->title = '参数配置';
  36. $this->applyCsrfToken('save');
  37. $this->query = ExtendService::queryChinaSmsBalance();
  38. // $this->query2 = ExtendService::queryGlobeSmsBalance();
  39. $this->crystal_switch = sysconf('crystal_switch');
  40. $this->sign_money_switch = sysconf('sign_money_switch');
  41. $this->vip_experience = sysconf('vip_experience');
  42. $this->user_level = UserLevel::column('name','id');
  43. $this->place_desc = [
  44. ''=>'全部',
  45. 'video'=>'视频',
  46. 'datum'=>'资料',
  47. 'article'=>'图文',
  48. 'supplier'=>'供应商商品',
  49. ];
  50. $this->module_list= UserSynth::getAllModuleTitle();
  51. $this->fetch();
  52. }
  53. /**
  54. * 保存商城参数
  55. * @auth true
  56. * @throws \think\Exception
  57. * @throws \think\exception\PDOException
  58. */
  59. public function save()
  60. {
  61. if ($this->request->isPost()) {
  62. $this->applyCsrfToken('save');
  63. foreach ($this->request->post() as $k => $v) sysconf($k, $v);
  64. $this->success('参数设置保存成功!');
  65. }
  66. }
  67. }