|
@@ -53,61 +53,15 @@ class IndexController extends Controller
|
|
],
|
|
],
|
|
];
|
|
];
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Displays homepage.
|
|
|
|
- *
|
|
|
|
- * @return string
|
|
|
|
- */
|
|
|
|
- public function actionIndex()
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- exit;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- $metrics=[
|
|
|
|
- 'sessions'=>"ga:sessions",
|
|
|
|
- 'bounceRate'=>"ga:bounceRate",
|
|
|
|
- 'sessionDuration'=>"ga:sessionDuration",
|
|
|
|
- 'hits'=>"ga:hits",
|
|
|
|
- 'transactions'=>"ga:transactions",
|
|
|
|
- 'transactionsPerSession'=>"ga:transactionsPerSession",
|
|
|
|
- 'transactionRevenue'=>"ga:transactionRevenue",
|
|
|
|
- 'totalValue'=>"ga:totalValue",
|
|
|
|
- 'itemQuantity'=>"ga:itemQuantity",
|
|
|
|
- 'productAddsToCart'=>"ga:productAddsToCart",
|
|
|
|
- 'productCheckouts'=>"ga:productCheckouts",
|
|
|
|
- 'productDetailViews'=>"ga:productDetailViews",
|
|
|
|
- ];
|
|
|
|
- $i=1;
|
|
|
|
- $res=[];
|
|
|
|
- $metrics=array_chunk($metrics,6,true);
|
|
|
|
- foreach($metrics as $metric){
|
|
|
|
- $response = $this->getReport($analytics,$metric);
|
|
|
|
- // $this->printResults($response);
|
|
|
|
- $data=$this->getResults($response);
|
|
|
|
- if(empty($res)){
|
|
|
|
- $res=$data;
|
|
|
|
- }else{
|
|
|
|
- echo "<pre>";
|
|
|
|
- print_r($res);
|
|
|
|
- print_r($data);
|
|
|
|
- echo "1111111\r\n";
|
|
|
|
- $res=array_merge_recursive($res,$data);
|
|
|
|
- echo "<pre>";
|
|
|
|
- print_r($res);
|
|
|
|
- exit;
|
|
|
|
- }
|
|
|
|
- // if(!empty($data)){
|
|
|
|
- // $res=empty($res)?$data:array_merge_recursive($res,$data);
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
- echo "<pre>";
|
|
|
|
- print_r($res);
|
|
|
|
- exit;
|
|
|
|
- return $this->render('index');
|
|
|
|
|
|
+ public function actionContentpage(){
|
|
|
|
+ $pages=ContentPage::find()->asArray()->all();
|
|
|
|
+ return [
|
|
|
|
+ 'code' => 200,
|
|
|
|
+ 'data'=>$pages,
|
|
|
|
+ 'status'=>true
|
|
|
|
+ ];
|
|
}
|
|
}
|
|
|
|
+
|
|
public function actionSynsdata(){
|
|
public function actionSynsdata(){
|
|
$ga=new GA();
|
|
$ga=new GA();
|
|
$store="supernova";
|
|
$store="supernova";
|