Setting.php 959 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. *
  4. * @copyright ©2020 点小铺
  5. * @author hanj
  6. * @link: https://dyuit.com
  7. * Created by VSCode
  8. */
  9. namespace app\store\controller\apps\wow;
  10. use app\store\controller\Controller;
  11. use app\store\model\wow\Setting as SettingModel;
  12. /**
  13. * 好物圈设置
  14. * Class Setting
  15. * @package app\store\controller\apps\wow
  16. */
  17. class Setting extends Controller
  18. {
  19. /**
  20. * 拼团设置
  21. * @return array|mixed
  22. * @throws \think\exception\DbException
  23. */
  24. public function index()
  25. {
  26. if (!$this->request->isAjax()) {
  27. $values = SettingModel::getItem('basic');
  28. return $this->fetch('index', compact('values'));
  29. }
  30. $model = new SettingModel;
  31. if ($model->edit('basic', $this->postData('basic'))) {
  32. return $this->renderSuccess('更新成功');
  33. }
  34. return $this->renderError($model->getError() ?: '更新失败');
  35. }
  36. }