<?php //6月版筛选统计需求 $andrlog = DQuery::input(array("date" => 0, "name" => "v2_map_android"))->select('getLog')->filter(array('os', 'match', '/android/i')); $iphonelog = DQuery::input(array("date" => 0, "name" => "v2_map_iphone"))->select('getLog')->filter(array('os', 'match', '/iphone/i')); function getLog($fields) { $res = array(); $res['act'] = $fields['_Key_ACT']; //key $res['os'] = $fields['_Key_OS']; $res['cuid'] = $fields['_Key_CUID']; $res['cat'] = $fields['_Key_PARAMS']['CAT']; //行业 $res['index'] = $fields['_Key_PARAMS']['LISTITEM_INDEX']; return $res; } $keylist = array('query' => array('0' => array('scope_tab_click', '范围tab点击'), '1' => array('category_tab_click', '类别tab点击'), '2' => array('sort_tab_click', '排序tab点击'))); foreach ($keylist as $cat => $keys) { $andrlog2 = $andrlog->filter(array('act', 'match', '/PoiListPG.filterBt/i')); $iphonelog2 = $iphonelog->filter(array('act', 'match', '/PoiListPG.filterBt/i')); foreach ($keys as $v1 => $v2) { $andrlog2->filter(array('index', '==', $v1))->group('cat')->countEach('*', 'c')->select(array('cat', 'c'))->outputAsFlie('android_' . $v2[0] . '_pv', 'android_' . $v2[1] . '_pv'); $andrlog2->filter(array('index', '==', $v1))->uniq(array('cuid', 'cat'))->group('cat')->countEach('*', 'c')->select(array('cat', 'c'))->outputAsFile('android_' . $v2[0] . '_uv', 'android_' . $v2[1] . '_uv'); $iphonelog2->filter(array('index', '==', $v1))->group('cat')->countEach('*', 'c')->select(array('cat', 'c'))->outputAsFile('iphone_' . $v2[0] . '_pv', 'iphone_' . $v2[1] . '_pv'); $iphonelog2->filter(array('index', '==', $v1))->uniq(array('cuid', 'cat'))->group('cat')->countEach('*', 'c')->select(array('cat', 'c'))->outputAsFile('iphone_' . $v2[0] . '_uv', 'iphone_' . $v2[1] . '_uv'); } }
<?php //全景分城市统计 $data = DQuery::input(array("date" => 0, "name" => "lbs_street_lighttpd_warning")); $queryData = $data->select('getData'); function getData($fields) { $res = array(); $res['os'] = $fields['_UrlFields']['os']; $res['qt'] = $fields['_UrlFields']['qt']; $res['_UrlPre'] = $fields['_UrlPre']; $res['cuid'] = $fields['_UrlFields']['cuid']; $res['z'] = $fields['_UrlFields']['z']; $res['fnc'] = $fields['_UrlFields']['fnc']; $res['qtStat'] = "0"; $res['city'] = "0"; $res['pid'] = $fields['_UrlFields']['pid']; $res['citycode'] = substr($res['pid'], 2, 4); if ($res['qt'] == 'ver' || $res['qt'] == 'proad' || $res['qt'] == 'vcfg') { $res['qtStat'] = 'no'; } else { $res['qtStat'] = 'yes'; } //city list $pid2city = array("0001" => "无锡市", "0002" => "武汉市", "0003" => "上海市", "0004" => "吉林市", "0005" => "白城市", "0006" => "长春市", "0007" => "辽源市", "0008" => "白山市", "0009" => "四平市", "0010" => "松原市", "0011" => "通化市", "0012" => "延边朝鲜族自治州", "0013" => "莆田市", "0014" => "南平市", "0015" => "龙岩市", "0016" => "宁德市", "0017" => "泉州市", "0018" => "三明市", "0019" => "厦门市", "0020" => "漳州市", "0021" => "福州市", "0022" => "北京市", "0023" => "淮安市", "0024" => "常州市", "0025" => "南京市", "0026" => "南通市", "0027" => "连云港市", "0028" => "徐州市", "0029" => "苏州市", "0030" => "宿迁市", "0031" => "泰州市", "0032" => "盐城市", "0033" => "扬州市", "0034" => "镇江市", "0035" => "九江市", "0036" => "吉安市", "0037" => "景德镇市", "0038" => "萍乡市", "0039" => "南昌市", "0040" => "新余市", "0041" => "上饶市", "0042" => "宜春市", "0043" => "鹰潭市", "0044" => "赣州市", "0045" => "抚州市", "0046" => "江门市", "0047" => "揭阳市", "0048" => "广州市", "0049" => "潮州市", "0050" => "茂名市", "0051" => "梅州市", "0052" => "清远市", "0053" => "佛山市", "0054" => "东沙群岛", "0055" => "汕尾市", "0056" => "汕头市", "0057" => "深圳市", "0058" => "韶关市", "0059" => "阳江市", "0060" => "湛江市", "0061" => "云浮市", "0062" => "中山市", "0063" => "珠海市", "0064" => "肇庆市", "0065" => "河源市", "0066" => "东莞市", "0067" => "惠州市", "0068" => "桂林市", "0069" => "贵港市", "0070" => "崇左市", "0071" => "防城港市", "0072" => "南宁市", "0073" => "来宾市", "0074" => "柳州市", "0075" => "钦州市", "0076" => "梧州市", "0077" => "北海市", "0078" => "玉林市", "0079" => "河池市", "0080" => "贺州市", "0081" => "百色市", "0082" => "贵阳市", "0083" => "安顺市", "0084" => "六盘水市", "0085" => "黔南布依族苗族自治州", "0086" => "黔东南苗族侗族自治州", "0087" => "黔西南布依族苗族自治州", "0088" => "毕节地区", "0089" => "铜仁地区", "0090" => "遵义市", "0091" => "安庆市", "0092" => "巢湖市", "0093" => "池州市", "0094" => "滁州市", "0095" => "黄山市", "0096" => "马鞍山市", "0097" => "淮南市", "0098" => "六安市", "0099" => "宣城市", "0100" => "淮北市", "0101" => "宿州市", "0102" => "铜陵市", "0103" => "芜湖市", "0104" => "蚌埠市", "0105" => "合肥市", "0106" => "亳州市", "0107" => "澳门特别行政区", "0108" => "本溪市", "0109" => "锦州市", "0110" => "朝阳市", "0111" => "辽阳市", "0112" => "盘锦市", "0113" => "阜新市", "0114" => "鞍山市", "0115" => "抚顺市", "0116" => "丹东市", "0117" => "沈阳市", "0118" => "铁岭市", "0119" => "大连市", "0120" => "营口市", "0121" => "葫芦岛市", "0122" => "赤峰市", "0123" => "阿拉善盟", "0124" => "兴安盟", "0125" => "通辽市", "0126" => "巴彦淖尔市", "0127" => "乌兰察布市", "0128" => "乌海市", "0129" => "锡林郭勒盟", "0130" => "呼伦贝尔市", "0131" => "呼和浩特市", "0132" => "鄂尔多斯市", "0133" => "包头市", "0134" => "固原市", "0135" => "石嘴山市", "0136" => "吴忠市", "0137" => "中卫市", "0138" => "银川市", "0139" => "果洛藏族自治州", "0140" => "黄南藏族自治州", "0141" => "西宁市", "0142" => "海北藏族自治州", "0143" => "海南藏族自治州", "0144" => "海西蒙古族藏族自治州", "0145" => "玉树藏族自治州", "0146" => "海东地区", "0147" => "哈密地区", "0148" => "博尔塔拉蒙古自治州", "0149" => "昌吉回族自治州", "0150" => "阿勒泰地区", "0151" => "新疆维吾尔自治区直辖县", "0152" => "喀什地区", "0153" => "克拉玛依市", "0154" => "阿克苏地区", "0155" => "克孜勒苏柯尔克孜自治州", "0156" => "塔城地区", "0157" => "吐鲁番地区", "0158" => "巴音郭楞蒙古自治州", "0159" => "乌鲁木齐市", "0160" => "伊犁哈萨克自治州", "0161" => "和田地区", "0162" => "济南市", "0163" => "济宁市", "0164" => "莱芜市", "0165" => "聊城市", "0166" => "德州市", "0167" => "临沂市", "0168" => "青岛市", "0169" => "日照市", "0170" => "淄博市", "0171" => "泰安市", "0172" => "潍坊市", "0173" => "威海市", "0174" => "烟台市", "0175" => "东营市", "0176" => "枣庄市", "0177" => "菏泽市", "0178" => "滨州市", "0179" => "晋城市", "0180" => "晋中市", "0181" => "长治市", "0182" => "吕梁市", "0183" => "临汾市", "0184" => "忻州市", "0185" => "朔州市", "0186" => "太原市", "0187" => "阳泉市", "0188" => "运城市", "0189" => "大同市", "0190" => "广安市", "0191" => "广元市", "0192" => "成都市", "0193" => "眉山市", "0194" => "凉山彝族自治州", "0195" => "绵阳市", "0196" => "攀枝花市", "0197" => "南充市", "0198" => "德阳市", "0199" => "乐山市", "0200" => "泸州市", "0201" => "内江市", "0202" => "甘孜藏族自治州", "0203" => "遂宁市", "0204" => "资阳市", "0205" => "巴中市", "0206" => "达州市", "0207" => "雅安市", "0208" => "自贡市", "0209" => "阿坝藏族羌族自治州", "0210" => "宜宾市", "0211" => "宝鸡市", "0212" => "安康市", "0213" => "商洛市", "0214" => "渭南市", "0215" => "西安市", "0216" => "铜川市", "0217" => "咸阳市", "0218" => "延安市", "0219" => "汉中市", "0220" => "榆林市", "0221" => "酒泉市", "0222" => "金昌市", "0223" => "嘉峪关市", "0224" => "兰州市", "0225" => "陇南市", "0226" => "平凉市", "0227" => "临夏回族自治州", "0228" => "庆阳市", "0229" => "甘南藏族自治州", "0230" => "武威市", "0231" => "定西市", "0232" => "天水市", "0233" => "张掖市", "0234" => "白银市", "0235" => "昌都地区", "0236" => "那曲地区", "0237" => "拉萨市", "0238" => "阿里地区", "0239" => "林芝地区", "0240" => "山南地区", "0241" => "日喀则地区", "0242" => "香港特别行政区", "0243" => "天津市", "0244" => "金华市", "0245" => "嘉兴市", "0246" => "衢州市", "0247" => "丽水市", "0248" => "宁波市", "0249" => "绍兴市", "0250" => "温州市", "0251" => "台州市", "0252" => "杭州市", "0253" => "舟山市", "0254" => "湖州市", "0255" => "楚雄彝族自治州", "0256" => "怒江傈僳族自治州", "0257" => "昆明市", "0258" => "普洱市", "0259" => "丽江市", "0260" => "德宏傣族景颇族自治州", "0261" => "临沧市", "0262" => "曲靖市", "0263" => "保山市", "0264" => "文山壮族苗族自治州", "0265" => "迪庆藏族自治州", "0266" => "西双版纳傣族自治州", "0267" => "大理白族自治州", "0268" => "红河哈尼族彝族自治州", "0269" => "玉溪市", "0270" => "昭通市", "0271" => "三亚市", "0272" => "海南省直辖县 ", "0273" => "海口市", "0274" => "焦作市", "0275" => "济源市", "0276" => "安阳市", "0277" => "开封市", "0278" => "洛阳市", "0279" => "漯河市", "0280" => "平顶山市", "0281" => "驻马店市", "0282" => "南阳市", "0283" => "濮阳市", "0284" => "新乡市", "0285" => "信阳市", "0286" => "许昌市", "0287" => "商丘市", "0288" => "三门峡市", "0289" => "郑州市", "0290" => "鹤壁市", "0291" => "周口市", "0292" => "重庆市", "0293" => "沧州市", "0294" => "承德市", "0295" => "廊坊市", "0296" => "秦皇岛市", "0297" => "邢台市", "0298" => "石家庄市", "0299" => "保定市", "0300" => "唐山市", "0301" => "张家口市", "0302" => "邯郸市", "0303" => "衡水市", "0304" => "鸡西市", "0305" => "佳木斯市", "0306" => "哈尔滨市", "0307" => "牡丹江市", "0308" => "齐齐哈尔市", "0309" => "七台河市", "0310" => "绥化市", "0311" => "双鸭山市", "0312" => "伊春市", "0313" => "大庆市", "0314" => "大兴安岭地区", "0315" => "鹤岗市", "0316" => "黑河市", "0317" => "常德市", "0318" => "长沙市", "0319" => "怀化市", "0320" => "郴州市", "0321" => "娄底市", "0322" => "邵阳市", "0323" => "湘潭市", "0324" => "湘西土家族苗族自治州", "0325" => "张家界市", "0326" => "益阳市", "0327" => "衡阳市", "0328" => "岳阳市", "0329" => "永州市", "0330" => "株洲市", "0331" => "荆门市", "0332" => "荆州市", "0333" => "黄石市", "0334" => "黄冈市", "0335" => "孝感市", "0336" => "随州市", "0337" => "恩施土家族苗族自治州", "0338" => "十堰市", "0339" => "襄樊市", "0340" => "咸宁市", "0341" => "宜昌市", "0342" => "鄂州市", "0343" => "湖北省直辖县", "0344" => "阜阳市", "0345" => "凤凰古城", "0346" => "河南省直辖县"); foreach ($pid2city as $citykey => $city) { if ($citykey == (string) $res['citycode']) { $res['city'] = $city; } } \Utils::trace($res);