|
@@ -106,5 +106,20 @@ class ThemeController extends CommonController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public function export() {
|
|
|
+ $theme_id = I('theme_id',1);
|
|
|
+ $where['theme_id'] = $theme_id;
|
|
|
+ $data = M('theme_detail')->field('date,count(*) as pv,count(distinct(uid)) as uv')->where($where)->group('date')->select();
|
|
|
+
|
|
|
+ $title = array(
|
|
|
+ 'date' => array('col' => 'A', 'name' => 'date'),
|
|
|
+ 'pv' => array('col' => 'B', 'name' => 'pv'),
|
|
|
+ 'uv' => array('col' => 'C', 'name' => 'uv'),
|
|
|
+ // 'vv' => array('col' => 'D', 'name' => 'vv'),
|
|
|
+ );
|
|
|
+ // Excel驱动导出数据
|
|
|
+ $excel = new \My\Excel(array('filename' => '芒果电信运营数据', 'title' => $title, 'data' => $data, 'msg' => L('common_not_data_tips')));
|
|
|
+ $excel->Export();
|
|
|
+ }
|
|
|
|
|
|
}
|