getList($this->request->param()); return $this->renderSuccess(compact('list')); } /** * 详情记录 * @param int $id * @return array */ public function detail(int $id) { $model = new SmsRemindModel; $detail = SmsRemindModel::detail($id); return $this->renderSuccess(compact('detail')); } /** * 添加现金卡 * @return array|string */ public function add() { // 新增记录 $model = new SmsRemindModel; $post = $this->postForm(); $post['ftype'] = 1; if ($model->add($post)) { return $this->renderSuccess('添加成功'); } return $this->renderError($model->getError() ?: '添加失败'); } /** * 编辑 * @param int $id * @return mixed */ public function edit(int $id) { // 详情 $model = SmsRemindModel::detail($id); // 更新记录 $post = $this->postForm(); if ($model->edit($post)) { return $this->renderSuccess('更新成功'); } return $this->renderError($model->getError() ?: '更新失败'); } }