function onrevokeComplainData() { //只查询转为投诉的问题 $ConditionList['transformed'] = 1; $action = "index.php?admin_complain/revokeComplainData"; $hasIntoComplainViewPrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoRevokeComplainData"); $hasIntoComplainViewPrivilege['url'] = "?admin_main"; !$hasIntoComplainViewPrivilege['return'] && __msg($hasIntoComplainViewPrivilege); $ConditionList['ComplainStartDate'] = isset($this->post['ComplainStartDate']) ? $this->post['ComplainStartDate'] : (isset($this->get[2]) ? $this->get[2] : date("Y-m-d", time() - 7 * 86400)); $ConditionList['ComplainEndDate'] = isset($this->post['ComplainEndDate']) ? $this->post['ComplainEndDate'] : (isset($this->get[3]) ? $this->get[3] : date("Y-m-d", time())); $ConditionList['author'] = isset($this->post['author']) ? urldecode(trim($this->post['author'])) : (isset($this->get[4]) ? urldecode(trim($this->get[4])) : ""); $ConditionList['author_id'] = isset($this->post['author_id']) ? trim($this->post['author_id']) : (isset($this->get[5]) ? trim($this->get[5]) : ""); $ConditionList['operator_loginId'] = isset($this->post['operator_loginId']) ? trim($this->post['operator_loginId']) : (isset($this->get[6]) ? trim($this->get[6]) : ""); $ConditionList['jid'] = isset($this->post['jid']) ? intval($this->post['jid']) : (isset($this->get[7]) ? intval($this->get[7]) : 0); $SellerTypeList = $this->ask_config->getSellerType(); $ConditionList['sid'] = isset($this->post['sid']) ? intval($this->post['sid']) : (isset($this->get[8]) ? intval($this->get[8]) : -1); $J = $this->cache->get("Jlist_" . $ConditionList['sid']); if (false !== $J) { $Jlist = json_decode($J, true); } else { $Jlist = $_ENV['complain']->getJList($ConditionList['sid']); $this->cache->set("Jlist_" . $ConditionList['sid'], json_encode($Jlist), 1800); } $ConditionList['status'] = 2; $ConditionList['Assess'] = -1; $ConditionList['reason'] = isset($this->post['reason']) ? urldecode(trim($this->post['reason'])) : (isset($this->get[9]) ? urldecode(trim($this->get[9])) : ""); $export = trim($this->get[10]) == "export" ? 1 : 0; $pagesize = $this->setting['list_default']; $pagesize = 20; $complainData = $_ENV['complain']->getRevokeComplainData($ConditionList); $downloadstr = page_url("<下载EXCEL表格>", "admin_complain/revokeComplainData/" . $ConditionList['ComplainStartDate'] . "/" . $ConditionList['ComplainEndDate'] . "/" . urlencode($ConditionList['author']) . "/" . $ConditionList['author_id'] . "/" . $ConditionList['operator_loginId'] . "/" . $ConditionList['jid'] . "/" . $ConditionList['sid'] . "/" . $ConditionList['reason'] . "/export"); if (!$export) { $msg && ($message = $msg); $ty && ($type = $ty); # Include FusionCharts PHP Class include TIPASK_ROOT . '/lib/fusion/Includes/FusionCharts_Gen.php'; $FC2 = new FusionCharts("Pie2d", '100%', '400'); $FC2->setSWFPath('../Charts/'); $strParam = "caption='撤销理由统计';xAxisName='理由';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=1;formatNumberScale=0;rotateNames=0;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,"; $FC2->setChartParams($strParam); $FC2->addDataset("撤销理由"); foreach ($complainData['RevokeReasonList'] as $r => $data) { $complainData['RevokeReasonList'][$r]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0; $FC2->addChartData($data['revokeCount'], 'name="' . $data['content'] . '"'); } $FC3 = new FusionCharts("Pie2d", '100%', '400'); $FC3->setSWFPath('../Charts/'); $strParam = "caption='交易类型统计';xAxisName='交易类型';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=1;formatNumberScale=0;rotateNames=0;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,"; $FC3->setChartParams($strParam); $FC3->addDataset("交易类型"); $jlist = $_ENV['complain']->getJList(0); unset($jlist[0]); foreach ($complainData['jList'] as $j => $data) { $complainData['jList'][$j]['jName'] = isset($jlist[$j]) ? $jlist[$j] : "未定义交易类型" . $j; $complainData['jList'][$j]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0; $FC3->addChartData($data['revokeCount'], "name=" . $complainData['jList'][$j]['jName']); } $FC4 = new FusionCharts("Pie2d", '100%', '400'); $FC4->setSWFPath('../Charts/'); $strParam = "caption='用户身份类型统计';xAxisName='身份类型';baseFontSize=12;numberPrefix=;numberSuffix=次;decimalPrecision=0;showValues=1;formatNumberScale=0;rotateNames=0;numDivLines=9;showAlternateHGridColor=1;alternateHGridAlpha=5;alternateHGridColor='CC3300';hoverCapSepChar=,"; $FC4->setChartParams($strParam); $FC4->addDataset("身份类型"); $SellerTypeList = $this->ask_config->getSellerType(); unset($slist[0]); foreach ($complainData['sList'] as $s => $data) { $complainData['sList'][$s]['sName'] = isset($SellerTypeList[$s]) ? $SellerTypeList[$s] : "未定义身份类型" . $s; $complainData['sList'][$s]['rate'] = $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0; $FC4->addChartData($data['revokeCount'], "name=" . $complainData['sList'][$s]['sName']); } } else { set_time_limit(0); require TIPASK_ROOT . '/lib/Excel.php'; $oExcel = new Excel(); $FileName = '已撤销投诉统计下载'; $oExcel->download($FileName); $oExcel->addSheet('撤销理由统计'); //标题栏 $title = array("撤销理由", "撤销次数", "问题占比"); $oExcel->addRows(array($title)); foreach ($complainData['RevokeReasonList'] as $r => $data) { $excelArr = array(); $excelArr = array("reason" => $data['content'], "revokeCount" => $data['revokeCount'], "rate" => $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0); $oExcel->addRows(array($excelArr)); } $oExcel->closeSheet(); $oExcel->addSheet('交易类型统计'); //标题栏 $title = array("交易类型", "撤销次数", "问题占比"); $oExcel->addRows(array($title)); $jlist = $_ENV['complain']->getJList(0); unset($jlist[0]); foreach ($complainData['jList'] as $j => $data) { $excelArr = array(); $excelArr = array("jname" => isset($jlist[$j]) ? $jlist[$j] : "未定义交易类型" . $j, "revokeCount" => $data['revokeCount'], "rate" => $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0); $oExcel->addRows(array($excelArr)); } $oExcel->closeSheet(); $oExcel->addSheet('身份类型统计'); //标题栏 $title = array("身份类型", "撤销次数", "问题占比"); $oExcel->addRows(array($title)); $SellerTypeList = $this->ask_config->getSellerType(); unset($slist[0]); foreach ($complainData['sList'] as $s => $data) { $excelArr = array(); $excelArr = array("sname" => isset($SellerTypeList[$s]) ? $SellerTypeList[$s] : "未定义身份类型" . $s, "revokeCount" => $data['revokeCount'], "rate" => $complainData['totalData']['complainCount'] > 0 ? $data['revokeCount'] / $complainData['totalData']['complainCount'] : 0); $oExcel->addRows(array($excelArr)); } $oExcel->closeSheet(); $oExcel->close(); } include template('revokecomplaindata', 'admin'); }
function ondatamonth() { set_time_limit(0); $year = trim($this->get[2]); $data_arr = $_ENV['question']->getDataMonth($year); require TIPASK_ROOT . '/lib/Excel.php'; $oExcel = new Excel(); $FileName = $year . "年每月数据"; $oExcel->download($FileName); $sheetArr = array('total_count' => '总咨询量', 'handle_count' => '已处理', 'yes' => '满意', 'no' => '不满意', 'none' => '未评价'); foreach ($sheetArr as $key => $value) { $oExcel->addSheet($value); $title = array('-1' => $value); for ($i = 1; $i <= 12; $i++) { $title[$i] = "第" . $i . "月"; } $oExcel->addRows(array($title)); ksort($data_arr); foreach ($data_arr as $cid => $cid_info) { $d = array('-1' => $cid_info['name']); for ($i = 1; $i <= 12; $i++) { $d[$i] = $cid_info[$key][$i]; } $oExcel->addRows(array($d)); ksort($cid_info['sub']); foreach ($cid_info['sub'] as $cid1 => $cid1_info) { $d = array('-1' => $cid1_info['name']); for ($i = 1; $i <= 12; $i++) { $d[$i] = $cid1_info[$key][$i]; } $oExcel->addRows(array($d)); ksort($cid1_info['sub']); foreach ($cid1_info['sub'] as $cid2 => $cid2_info) { $d = array('-1' => $cid2_info['name']); for ($i = 1; $i <= 12; $i++) { $d[$i] = $cid2_info[$key][$i]; } $oExcel->addRows(array($d)); ksort($cid2_info['sub']); foreach ($cid2_info['sub'] as $cid3 => $cid3_info) { $d = array('-1' => $cid3_info['name']); for ($i = 1; $i <= 12; $i++) { $d[$i] = $cid3_info[$key][$i]; } $oExcel->addRows(array($d)); ksort($cid3_info['sub']); foreach ($cid3_info['sub'] as $cid4 => $cid4_info) { $d = array('-1' => $cid4_info['name']); for ($i = 1; $i <= 12; $i++) { $d[$i] = $cid4_info[$key][$i]; } $oExcel->addRows(array($d)); } } } } } $oExcel->closeSheet(); } $oExcel->close(); }