Wxapp.php 751 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\store\controller;
  3. use app\store\model\Wxapp as WxappModel;
  4. /**
  5. * 小程序管理
  6. * Class Wxapp
  7. * @package app\store\controller
  8. */
  9. class Wxapp extends Controller
  10. {
  11. /**
  12. * 小程序设置
  13. * @return mixed
  14. * @throws \think\exception\DbException
  15. */
  16. public function setting()
  17. {
  18. // 当前小程序信息
  19. $model = WxappModel::detail();
  20. if (!$this->request->isAjax()) {
  21. return $this->fetch('setting', compact('model'));
  22. }
  23. // 更新小程序设置
  24. if ($model->edit($this->postData('wxapp'))) {
  25. return $this->renderSuccess('更新成功');
  26. }
  27. return $this->renderError($model->getError() ?: '更新失败');
  28. }
  29. }