// +---------------------------------------------------------------------- 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")); } }