123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- declare (strict_types = 1);
- namespace app\store\controller;
- use app\store\controller\Controller;
- use app\common\model\SmsRemind as SmsRemindModel;
- /**
- * 短信提醒管理控制器
- * Class RiceCard
- * @package app\store\controller\card
- */
- class SmsRemind extends Controller
- {
- public function list()
- {
- $model = new SmsRemindModel;
- $list = $model->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() ?: '更新失败');
- }
- }
|