|
@@ -12,46 +12,11 @@ use app\models\ContentPage;
|
|
|
|
|
|
class IndexController extends Controller
|
|
|
{
|
|
|
- /**
|
|
|
- * {@inheritdoc}
|
|
|
- */
|
|
|
- public function behaviors()
|
|
|
- {
|
|
|
- return [
|
|
|
- 'access' => [
|
|
|
- 'class' => AccessControl::className(),
|
|
|
- 'only' => ['logout'],
|
|
|
- 'rules' => [
|
|
|
- [
|
|
|
- 'actions' => ['logout'],
|
|
|
- 'allow' => true,
|
|
|
- 'roles' => ['@'],
|
|
|
- ],
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'verbs' => [
|
|
|
- 'class' => VerbFilter::className(),
|
|
|
- 'actions' => [
|
|
|
- 'logout' => ['post'],
|
|
|
- ],
|
|
|
- ],
|
|
|
- ];
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
- /**
|
|
|
- * {@inheritdoc}
|
|
|
- */
|
|
|
- public function actions()
|
|
|
- {
|
|
|
- return [
|
|
|
- 'error' => [
|
|
|
- 'class' => 'yii\web\ErrorAction',
|
|
|
- ],
|
|
|
- 'captcha' => [
|
|
|
- 'class' => 'yii\captcha\CaptchaAction',
|
|
|
- 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
|
|
|
- ],
|
|
|
- ];
|
|
|
+
|
|
|
+ public function actionIndex(){
|
|
|
+ echo 111;exit;
|
|
|
}
|
|
|
public function actionContentpage(){
|
|
|
$pages=ContentPage::find()->asArray()->all();
|
|
@@ -116,107 +81,4 @@ class IndexController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
-/**
|
|
|
- * Parses and prints the Analytics Reporting API V4 response.
|
|
|
- *
|
|
|
- * @param An Analytics Reporting API V4 response.
|
|
|
- */
|
|
|
-function printResults($reports) {
|
|
|
- for ( $reportIndex = 0; $reportIndex < count( $reports ); $reportIndex++ ) {
|
|
|
- $report = $reports[ $reportIndex ];
|
|
|
-
|
|
|
- $header = $report->getColumnHeader();
|
|
|
- $dimensionHeaders = $header->getDimensions();
|
|
|
- $metricHeaders = $header->getMetricHeader()->getMetricHeaderEntries();
|
|
|
- $rows = $report->getData()->getRows();
|
|
|
-
|
|
|
-
|
|
|
- for ( $rowIndex = 0; $rowIndex < count($rows); $rowIndex++) {
|
|
|
- $row = $rows[ $rowIndex ];
|
|
|
- $dimensions = $row->getDimensions();
|
|
|
-
|
|
|
- $metrics = $row->getMetrics();
|
|
|
- if($dimensionHeaders&&$dimensions){
|
|
|
- for ($i = 0; $i < count($dimensionHeaders) && $i < count($dimensions); $i++) {
|
|
|
- print($dimensionHeaders[$i] . ": " . $dimensions[$i] . "\n\r");
|
|
|
- echo"<br/>";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if($metricHeaders&&$metrics){
|
|
|
- for ($j = 0; $j < count($metrics); $j++) {
|
|
|
- $values = $metrics[$j]->getValues();
|
|
|
- for ($k = 0; $k < count($values); $k++) {
|
|
|
- $entry = $metricHeaders[$k];
|
|
|
- print($entry->getName() . ": " . $values[$k] . "\n\r");
|
|
|
- echo"<br/>";
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-function getResults($reports) {
|
|
|
- $data=[];
|
|
|
- for ( $reportIndex = 0; $reportIndex < count( $reports ); $reportIndex++ ) {
|
|
|
- $item=[];
|
|
|
- $report = $reports[ $reportIndex ];
|
|
|
-
|
|
|
- $header = $report->getColumnHeader();
|
|
|
- $dimensionHeaders = $header->getDimensions();
|
|
|
- $metricHeaders = $header->getMetricHeader()->getMetricHeaderEntries();
|
|
|
- $rows = $report->getData()->getRows();
|
|
|
-
|
|
|
-
|
|
|
- for ( $rowIndex = 0; $rowIndex < count($rows); $rowIndex++) {
|
|
|
- $row = $rows[ $rowIndex ];
|
|
|
- $dimensions = $row->getDimensions();
|
|
|
-
|
|
|
- $metrics = $row->getMetrics();
|
|
|
- // echo "<pre>";
|
|
|
- if($dimensionHeaders&&$dimensions){
|
|
|
- // for ($i = 0; $i < count($dimensionHeaders) && $i < count($dimensions); $i++) {
|
|
|
- // $list[$dimensionHeaders[$i]]=
|
|
|
- // print($dimensionHeaders[$i] . ": " . $dimensions[$i] . "\n\r");
|
|
|
- // echo"<br/>";
|
|
|
- // }
|
|
|
- $date=$dimensions[0];
|
|
|
- $date=date('Y-m-d',strtotime($date));
|
|
|
-
|
|
|
- }else{
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- if($metricHeaders&&$metrics){
|
|
|
- for ($j = 0; $j < count($metrics); $j++) {
|
|
|
- $values = $metrics[$j]->getValues();
|
|
|
- for ($k = 0; $k < count($values); $k++) {
|
|
|
- $entry = $metricHeaders[$k];
|
|
|
- $data[$date][$entry->getName()]=$values[$k];
|
|
|
- // print($entry->getName() . ": " . $values[$k] . "\n\r");
|
|
|
- // echo"<br/>";
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- return $data;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-}
|