12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- declare (strict_types=1);
- namespace app\store\controller\analysis;
- use app\store\controller\Controller;
- use app\store\model\analysis\AnalysisDailyVisit;
- use app\store\model\analysis\AnalysisMonthlyVisit;
- use app\store\model\analysis\AnalysisPageVisit;
- use app\store\model\analysis\AnalysisWeeklyVisit;
- use app\common\service\Export as ExportService;
- /**
- * 页面分析
- *
- * Class Page
- * @package app\store\controller\analysis
- */
- class Page extends Controller
- {
- /**
- * 访问页面
- *
- * @return array
- */
- public function pageVisit()
- {
- $params = $this->request->param();
- $tables = AnalysisPageVisit::getList($params);
- list($start,$end) = AnalysisPageVisit::getStartEndTime($params);
- $data = [
- 'start' => date('Y-m-d', $start),
- 'end' => date('Y-m-d', $end),
- 'table' => $tables
- ];
- return $this->renderSuccess($data);
- }
- public function export()
- {
- $param = $this->request->param();
- $model = new AnalysisPageVisit;
- $data = $model->export($param);
- $res = ExportService::export($data['data'],$data['header'],$data['filename'],'列表','Xls');
- return $this->renderSuccess($res,'下载成功');
- }
- }
|