| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\admin\controller\user;
- use app\common\controller\Backend;
- /**
- * 新人福利管理
- *
- * @icon fa fa-circle-o
- */
- class Welfare extends Backend
- {
- /**
- * Welfare模型对象
- * @var \app\admin\model\user\Welfare
- */
- protected $model = null;
- public function _initialize()
- {
- parent::_initialize();
- $this->model = new \app\common\model\UserWelfare;
- }
- /**
- * 查看
- */
- public function index()
- {
- $row = $this->model->get(1);
- if ($this->request->isPost()) {
- $params = $this->request->post("row/a");
- $result = $row->allowField(true)->save($params);
- $this->success("提交成功", null, ['data' => json_encode($this->request->post("row/a"), JSON_UNESCAPED_UNICODE)]);
- }
- $this->view->assign('row', $row);
- return $this->view->fetch();
- }
- }
|