request->isAjax()) { $values = SettingModel::getItem('submsg'); return $this->fetch('index', compact('values')); } $model = new SettingModel; if ($model->edit('submsg', $this->postData('submsg'))) { return $this->renderSuccess('操作成功'); } return $this->renderError($model->getError() ?: '操作失败'); } /** * 一键添加订阅消息 * @return array * @throws \app\common\exception\BaseException * @throws \think\Exception * @throws \think\exception\DbException */ public function shuttle() { $SubMsgService = new SubMsgService; if ($SubMsgService->shuttle()) { return $this->renderSuccess('操作成功'); } return $this->renderError($SubMsgService->getError() ?: '操作失败'); } }