HomeAction::feedback PHP Method

feedback() public method

运营工具 - 意见反馈 - 意见反馈列表
public feedback ( )
    public function feedback()
    {
        // 列表key值 DOACTION表示操作
        $this->pageKeyList = array('id', 'feedbacktype', 'feedback', 'uid', 'cTime', 'type', 'DOACTION');
        $this->pageTab[] = array('title' => L('PUBLIC_FEEDBACK_LIST'), 'tabHash' => 'list', 'url' => U('admin/Home/feedback'));
        $this->pageTab[] = array('title' => L('PUBLIC_FEEDBACK_TYPE'), 'tabHash' => 'type', 'url' => U('admin/Home/feedbackType'));
        $this->pageButton[] = array('title' => L('PUBLIC_ALREADY_PROCESSED'), 'onclick' => "location.href = '" . U('admin/Home/feedback', array('type' => 'true')) . "'");
        $this->pageButton[] = array('title' => L('PUBLIC_WAIT_PROCESSE'), 'onclick' => "location.href = '" . U('admin/Home/feedback', array('type' => 'false')) . "'");
        // 列表分页栏 按钮
        $this->allSelected = false;
        $this->assign('pageTitle', L('PUBLIC_FEEDBACK_MANAGE'));
        // 数据的格式化 与listKey保持一致
        if ($_GET['type']) {
            if ($_GET['type'] == 'true') {
                $listData = model('Feedback')->where('type = 1')->order('cTime desc')->findPage(20);
            } else {
                $listData = model('Feedback')->where('type = 0')->order('cTime desc')->findPage(20);
            }
        } else {
            $listData = model('Feedback')->order('cTime desc')->findPage(20);
        }
        foreach ($listData['data'] as &$v) {
            // TODO:附件处理
            $userInfo = model('User')->getUserInfo($v['uid']);
            $feedbacktype = model('Feedback')->getFeedBackType();
            $v['feedbacktype'] = $feedbacktype[$v['feedbacktype']];
            $v['cTime'] = friendlyDate($v['cTime']);
            $v['uid'] = $userInfo['space_link'];
            if ($v['type'] != 1) {
                $v['type'] = L('PUBLIC_WAIT_PROCESSE');
                $v['DOACTION'] = '<a href="' . U('admin/Home/feedback_list', array('id' => $v['id'])) . '">' . L('PUBLIC_VIEW') . '</a><a href="' . U('admin/Home/delfeedback', array('id' => $v['id'])) . '" >' . L('PUBLIC_MARK_PROCESSED') . '</a>';
            } else {
                $v['type'] = L('PUBLIC_ALREADY_PROCESSED');
                $v['DOACTION'] = '<a href="' . U('admin/Home/feedback_list', array('id' => $v['id'])) . '">' . L('PUBLIC_VIEW') . '</a>';
            }
        }
        $this->allSelected = false;
        $this->displayList($listData);
    }