• phpadmin 导出csv格式的数据处理


    将对应的字段转化为汉字,如下代码
    <?php
    date_default_timezone_set('UTC');
    include("./fcrm_shop_info_foraudit.php");
    include("./userList.php");
    
    $fp = fopen('./shop_export' . date('Y_m_d') . '.csv', "w+");
    
    $header = array(
        'shopid',
        '门店名称',
        '机构名称',
        '签约渠道',
        '所属大区',
        '签约BD',
    );
    fputcsv($fp,$header);
    
    $ChannelCode = array(
        'KA' => '大客户部',
        'BF' => '北京分公司',
        'SF' => '深圳分公司',
        'SH' => '上海分公司',
        'GF' => '广州分公司',
        'YP' => '沈阳盘古',
        'BO' => '博德',
        'NS' => '南京首屏',
        'WH' => '武汉百捷',
        'BD' => '仅英孚Home、汇众',
        'HP' => '河北盘古',
        'CP' => '长春盘古',
        'HS' => '杭州首屏',
        'BA' => '成都百都',
        'BN' => '福建百纳',
        'KC' => '山东开创',
        'QD' => '青岛商至信',
        'QS' => '天津企商',
        'JW' => '湖南竞网',
        'HN' => '河南锐之旗',
        'WR' => '重庆网润',
        'WX' => '安徽网新',
        'DL' => '大连龙采',
        'LC' => '黑龙江龙采',
        'JX' => '广西集翔',
        'QA' => 'QA测试',
        'SX' => '山西龙采',
        'GJ' => '宁波国技',
        'BU' => '江苏百拓',
        'SK' => '盐城思科',
        'YE' => '厦门易尔通',
        'CW' => '云南创网',
        'HB' => '江西华邦',
        'KQ' => '呼和浩特开企',
        'BT' => '台州百泰',
        'JS' => '金华激石',
        'QZ' => '青之峰',
        'WB' => '江苏网博',
        'WE' => '烟台文博',
        'ZX' => '山东中迅',
        'QF' => '河南青峰',
        'XW' => '海南鑫网',
        'YS' => '易森',
        'RY' => '热源口腔',
        'ZB' => '百度金融事业部',
        'DF' => '大连非常完美',
        'FJ' => '山东济南福君',
        'LQ' => '兰州前海普惠',
        'CQ' => '重庆前海普惠',
        'ZS' => '淄博盛仁',
        'HX' => '南京厚学',
        'YF' => '四川玉易凡',
        'KF' => '武汉快乐分享',
        'SB' => '烟威思博',
        'ZD' => '郑州大发',
        'PY' => '濮阳源始',
        'TR' => '重庆天火同仁',
        'ZJ' => '杭州筑家易',
        'HC' => '山西衡智传媒',
        'XB' => '校宝在线',
        'XF' => '西区分公司',
    );
    foreach ($fcrm_shop_info_foraudit as $row){
        $data['shop_id'] = $row['shop_id'];
        $data['shop_name'] = $row['shop_name'];
        $data['institution_name'] = $row['institution_name'];
        $data['channel_id'] = $ChannelCode[$row['channel_id']];
        $data['belong_area'] = $area[$row['channel_id']];
        $data['userid'] = $arrUser[$row['create_bd_ucid']]['username'];
        fputcsv($fp,$data);
    }
    fclose($fp);
    
    
  • 相关阅读:
    区间覆盖(线段树)
    差分约束
    二维数组
    P1195 口袋的天空
    dp的刷表法和填表法
    P1284 三角形牧场
    数据库课程设计
    具体解释VB中连接access数据库的几种方法
    android之PackageManager简单介绍
    Oracle fga审计有这几个特性
  • 原文地址:https://www.cnblogs.com/liuqun/p/12655190.html
Copyright © 2020-2023  润新知