Recharge.php 768 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\store\controller\market;
  3. use app\store\controller\Controller;
  4. use app\store\model\Setting as SettingModel;
  5. class Recharge extends Controller
  6. {
  7. /**
  8. * 充值设置
  9. * @return array|bool|mixed
  10. * @throws \think\exception\DbException
  11. */
  12. public function setting()
  13. {
  14. if (!$this->request->isAjax()) {
  15. $values = SettingModel::getItem('recharge');
  16. return $this->fetch('setting', ['values' => $values]);
  17. }
  18. $model = new SettingModel;
  19. if ($model->edit('recharge', $this->postData('recharge'))) {
  20. return $this->renderSuccess('操作成功');
  21. }
  22. return $this->renderError($model->getError() ?: '操作失败');
  23. }
  24. }