AdminAction::_getData PHP Метод

_getData() приватный Метод

获取内容信息
private _getData ( array $map, string $type ) : array
$map array 查询条件
$type string 类型
Результат array 获取相应的列表信息
    private function _getData($map, $type)
    {
        // 键值对
        $this->pageKeyList = array('id', 'cid', 'uname', 'content', 'status', 'category', 'DOACTION');
        $data = D('Channel', 'channel')->getChannelList($map);
        // 组装数据
        foreach ($data['data'] as &$value) {
            $value['id'] = $value['feed_id'];
            $value['cid'] = $value['feed_channel_link_id'];
            $value['content'] = '<div style="width:500px;line-height:22px" model-node="feed_list">' . $value['content'] . '  <a target="_blank" href="' . U('public/Profile/feed', array('feed_id' => $value['feed_id'], 'uid' => $value['uid'])) . '">' . L('PUBLIC_VIEW_DETAIL') . '&raquo;</a></div>';
            $value['status'] = $value['status'] == 1 ? '<span style="color:green;cursor:auto;">已审核</span>' : '<span style="color:red;cursor:auto;">未审核</span>';
            $value['category'] = implode('<br />', getSubByKey($value['categoryInfo'], 'title'));
            switch ($type) {
                case 'audit':
                    $value['DOACTION'] = '<a href="javascript:;" onclick="admin.cancelRecommended(' . $value['feed_id'] . ')">取消推荐</a>';
                    break;
                case 'unaudit':
                    $channelId = implode(',', getSubByKey($value['categoryInfo'], 'channel_category_id'));
                    $value['DOACTION'] = '<a href="javascript:;" onclick="admin.auditChannelList(' . $value['feed_id'] . ', \'' . $channelId . '\')">通过审核</a>&nbsp;-&nbsp;<a href="javascript:;" onclick="admin.rejectChannel(' . $value['feed_id'] . ')">驳回</a>';
                    break;
            }
        }
        return $data;
    }