123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author:kane < chengjin005@163.com>
- // +----------------------------------------------------------------------
- namespace app\portal\controller;
- use app\portal\model\FeedbackModel;
- use app\portal\model\PortalTagModel;
- use cmf\controller\AdminBaseController;
- use think\Db;
- /**
- * Class AdminTagController 标签管理控制器
- * @package app\portal\controller
- */
- class AdminFeedbackController extends AdminBaseController
- {
- public function index()
- {
- $param = $this->request->param();
- //搜索条件
- $where = [];
- if (!empty($param['type'])) {
- $where[] = ['type', '=', $param['type']];
- }
- if (!empty($param['status'])) {
- $where[] = ['status', '=', $param['status']];
- }
- $model = new FeedbackModel();
- $list = $model->where($where)->order('status asc,create_time desc')->paginate();
- $this->assign("arrStatus", $model::$STATUS);
- $this->assign("arrType", $model::$TYPE);
- $this->assign('type', isset($param['type']) ? $param['type'] : '');
- $this->assign('status', isset($param['status']) ? $param['status'] : '');
- $this->assign('list', $list);
- $this->assign('page', $list->render());
- return $this->fetch();
- }
- public function read()
- {
- $id = $this->request->param("id");
- if (empty($id)) {
- $this->error(lang("NO_ID"));
- }
- $model = new FeedbackModel();
- $model->isUpdate(true)->save(["status" => 1], ["id" => $id]);
- $this->success(lang("SAVE_SUCCESS"));
- }
- }
|