|
@@ -1638,81 +1638,10 @@ class ROrderController extends AdminController{
|
|
|
CommonFn::SaveViaTempFile($objWriter);
|
|
|
|
|
|
}
|
|
|
- public function actionTest(){
|
|
|
- $arr = array(
|
|
|
- array('', '一班', '二班', '三班','四班'),
|
|
|
- array('不及格', 20, 30, 40,67),
|
|
|
- array('良好', 30, 50, 55,67),
|
|
|
- array('优秀', 15, 17, 20,67)
|
|
|
- );
|
|
|
- Yii::$enableIncludePath = false;
|
|
|
- Yii::import('ext.phpexcel.PHPExcel', 1);
|
|
|
-
|
|
|
- $objPHPExcel = new PHPExcel();
|
|
|
- $objSheet = $objPHPExcel->getActiveSheet();
|
|
|
- $criteria = new EMongoCriteria();
|
|
|
- $criteria->status('==',1);
|
|
|
-
|
|
|
- $name = '同比数据分析(月)柱形图.xlsx';
|
|
|
-
|
|
|
- $objSheet->fromArray($arr);
|
|
|
-
|
|
|
- //图表
|
|
|
- $labels = array(
|
|
|
- new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$B$1', null, 1),//一班
|
|
|
- new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$C$1', null, 1),//二班
|
|
|
- new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$D$1', null, 1),//三班
|
|
|
- new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$E$1', null, 1),//三班
|
|
|
- );
|
|
|
- $xLabels = array(
|
|
|
- new PHPExcel_Chart_DataSeriesValues('String', 'Worksheet!$A$2:$A$4', null, 3),
|
|
|
- );
|
|
|
- $datas = array(
|
|
|
- new PHPExcel_Chart_DataSeriesValues('Number', 'Worksheet!$B$2:$B$4', null, 4),//取一班的数据
|
|
|
- new PHPExcel_Chart_DataSeriesValues('Number', 'Worksheet!$C$2:$C$4', null, 4),//取二班的数据
|
|
|
- new PHPExcel_Chart_DataSeriesValues('Number', 'Worksheet!$D$2:$D$4', null, 4),//取三班的数据
|
|
|
- new PHPExcel_Chart_DataSeriesValues('Number', 'Worksheet!$E$2:$E$4', null, 4),//取三班的数据
|
|
|
-
|
|
|
- );
|
|
|
-
|
|
|
-
|
|
|
- $series = array(
|
|
|
- new PHPExcel_Chart_DataSeries(
|
|
|
- PHPExcel_Chart_DataSeries::TYPE_BARCHART,
|
|
|
- PHPExcel_Chart_DataSeries::GROUPING_STANDARD,
|
|
|
- range(0, count($labels)-1),
|
|
|
- $labels,
|
|
|
- $xLabels,
|
|
|
- $datas
|
|
|
- )
|
|
|
- ); //图表框架
|
|
|
-
|
|
|
- $layout=new PHPExcel_Chart_Layout();
|
|
|
- $layout->setShowVal(true);
|
|
|
- $areas = new PHPExcel_Chart_PlotArea(null,$series);
|
|
|
- $legend = new PHPExcel_Chart_Legend(PHPExcel_Chart_Legend::POSITION_RIGHT,$layout,false);
|
|
|
- $title = new PHPExcel_Chart_Title("同比数据分析");
|
|
|
- $ytitle = new PHPExcel_Chart_Title("订单数");
|
|
|
- $chart = new PHPExcel_Chart('line_chart',$title,$legend,$areas,true,false,null,$ytitle);
|
|
|
- $chart->setTopLeftPosition("A1")->setBottomRightPosition("P31"); //图表位置
|
|
|
-
|
|
|
- $objSheet->addChart($chart);
|
|
|
-
|
|
|
-
|
|
|
- $excel = 'Excel2007';
|
|
|
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,$excel);
|
|
|
- $objWriter->setIncludeCharts(true); //图表必须
|
|
|
- // $objWriter->save($dir.'/export.xls'); //生成excel文件
|
|
|
- CommonFn::browser_export($excel,date('m').$name); //浏览器输出
|
|
|
-
|
|
|
- CommonFn::SaveViaTempFile($objWriter);
|
|
|
|
|
|
+ public function actionTest(){
|
|
|
+ CommonSMS::send('test');
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|