<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                ## 后臺控制器樣例 ``` <?php namespace app\user\admin; use app\admin\admin\Base; use app\user\model\Level as LevelModel; use service\Format; /** * 會員等級控制器 * @package app\Level\admin */ class Level extends Base { /** * 會員等級列表 * @author 似水星辰 [2630481389@qq.com] * @return mixed */ public function index() { cookie('__forward__', $_SERVER['REQUEST_URI']); // 查詢 $map = $this->getMap(); // 排序 $order = $this->getOrder(); // 數據列表 $data_list = LevelModel::where($map)->order($order)->paginate(); $fields = [ ['id', 'ID'], ['name', '等級名稱'], ['upgrade_score', '升級所需分數'], ['levelid', '等級標識'], ['right_button', '操作', 'btn', '', '', 'text-center'] ]; return Format::ins()//實例化 ->addColumns($fields)//設置字段 ->setTopButtons($this->top_button) ->setRightButtons($this->right_button) ->setData($data_list)//設置數據 ->fetch();//顯示 } /** * 新增 * @author 似水星辰 [2630481389@qq.com] * @return mixed */ public function add() { // 保存數據 if ($this->request->isPost()) { // 表單數據 $data = $this->request->post(); // 驗證 $result = $this->validate($data, 'Level'); if (true !== $result) $this->error($result); if ($page = LevelModel::create($data)) { $this->success('新增成功', cookie('__forward__')); } else { $this->error('新增失敗'); } } $fields = [ ['type' => 'text', 'name' => 'name', 'title' => '等級名稱', 'tips' => '', 'attr' => '', 'value' => ''], ['type' => 'number', 'name' => 'upgrade_score', 'title' => '升級所需分數', 'tips' => '', 'attr' => '', 'value' => '0'], ['type' => 'number', 'name' => 'levelid', 'title' => '等級標識', 'tips' => '', 'attr' => '', 'value' => '0'], ]; $this->assign('page_title', '新增會員等級'); $this->assign('form_items', $fields); return $this->fetch('../../admin/public/add'); } /** * 編輯 * @param null $id 會員等級id * @author 似水星辰 [2630481389@qq.com] * @return mixed */ public function edit($id = null) { if ($id === null) $this->error('缺少參數'); // 保存數據 if ($this->request->isPost()) { // 表單數據 $data = $this->request->post(); // 驗證 $result = $this->validate($data, 'Level'); if (true !== $result) $this->error($result); if (LevelModel::update($data)) { $this->success('編輯成功', cookie('__forward__')); } else { $this->error('編輯失敗'); } } $info = LevelModel::get($id); $fields = [ ['type' => 'hidden', 'name' => 'id'], ['type' => 'text', 'name' => 'name', 'title' => '等級名稱', 'tips' => '', 'attr' => '', 'value' => ''], ['type' => 'number', 'name' => 'upgrade_score', 'title' => '升級所需分數', 'tips' => '', 'attr' => '', 'value' => '0'], ['type' => 'number', 'name' => 'levelid', 'title' => '等級標識', 'tips' => '', 'attr' => '', 'value' => '0'], ]; $this->assign('page_title', '編輯會員等級'); $this->assign('form_items', $this->setData($fields, $info)); return $this->fetch('../../admin/public/edit'); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看