Setting.php 855 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\shop\controller\plus\assemble;
  3. use app\shop\controller\Controller;
  4. use app\shop\model\settings\Setting as SettingModel;
  5. /**
  6. * 整点秒杀设置
  7. */
  8. class Setting extends Controller
  9. {
  10. /**
  11. *获取拼团设置
  12. */
  13. public function getSetting()
  14. {
  15. $vars['values'] = SettingModel::getItem('assemble');
  16. return $this->renderSuccess('', compact('vars'));
  17. }
  18. /**
  19. * 拼团设置
  20. */
  21. public function index()
  22. {
  23. if($this->request->isGet()){
  24. return $this->getSetting();
  25. }
  26. $model = new SettingModel;
  27. $data = $this->request->param();
  28. if ($model->edit('assemble', $data)) {
  29. return $this->renderSuccess('操作成功');
  30. }
  31. return $this->renderError('操作失败');
  32. }
  33. }