2017 © Pedro Peláez
 

library baidu-tongji

image

melodic/baidu-tongji

  • Tuesday, July 18, 2017
  • by melodic
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 14 % Grown

The README.md

tp5-baidutongji

感谢 https://github.com/mushan0703/BaiduTongji, (*1)

主要是参考这个项目做了一点小的调整, (*2)

请参考百度统计文档使用,本项目可以配合tp5 + 使用, (*3)

安装

  1. 安装包文件, (*4)

    composer require melodic/baidu-tongji
    
<?php

namespace app\Index\Controllers;

use think\Controller;
use Melodic\Tongji\BaiduTongji;

class Index extends Controller
{

    public function index()
    {
        $baiduTongji= new BaiduTongji();
        $today=date('Ymd');
        $yesterday=date('Ymd',strtotime('yesterday'));
        $result=$baiduTongji->getData([
            'method' => 'trend/time/a',
            'start_date' => $today,
            'end_date' => $today,
            'start_date2' => $yesterday,
            'end_date2' => $yesterday,
            'metrics' => 'pv_count,visitor_count',
            'max_results' => 0,
            'gran' => 'day',
        ]);
        return json($result);
    }
}

The Versions

18/07 2017

dev-master

9999999-dev

  Sources   Download

The Requires

  • php >=5.4.0

 

by Avatar Remo

18/07 2017

1.0

1.0.0.0

  Sources   Download

by Avatar Remo