Recharge.php 885 B

123456789101112131415161718192021222324252627282930313233343536
  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\market;
  10. use app\store\controller\Controller;
  11. use app\store\model\Setting as SettingModel;
  12. class Recharge extends Controller
  13. {
  14. /**
  15. * 充值设置
  16. * @return array|bool|mixed
  17. * @throws \think\exception\DbException
  18. */
  19. public function setting()
  20. {
  21. if (!$this->request->isAjax()) {
  22. $values = SettingModel::getItem('recharge');
  23. return $this->fetch('setting', ['values' => $values]);
  24. }
  25. $model = new SettingModel;
  26. if ($model->edit('recharge', $this->postData('recharge'))) {
  27. return $this->renderSuccess('操作成功');
  28. }
  29. return $this->renderError($model->getError() ?: '操作失败');
  30. }
  31. }