|
@@ -76,9 +76,10 @@ class IndexController extends \app\controllers\HomeController
|
|
|
'dp'=>$store,
|
|
|
'dimensionArr'=>$v,
|
|
|
'metricArr'=>[
|
|
|
- '销量'=>"ga:itemQuantity",
|
|
|
- '订单量'=>"ga:transactions",
|
|
|
- '订单金额'=>"ga:transactionRevenue",
|
|
|
+ 'itemQuantity'=>"ga:itemQuantity",
|
|
|
+ 'transactions'=>"ga:transactions",
|
|
|
+ 'transactionRevenue'=>"ga:transactionRevenue",
|
|
|
+ 'pageviews'=>"ga:pageviews",
|
|
|
],
|
|
|
'date'=>['start_at'=>$start_day,'end_at'=>$end_day]
|
|
|
];
|
|
@@ -317,7 +318,43 @@ class IndexController extends \app\controllers\HomeController
|
|
|
if(!$productName||!$store){
|
|
|
$this->json(0,[],'参数错误');
|
|
|
}
|
|
|
- $storeConfig=[
|
|
|
+ $times=[
|
|
|
+ 'hour'=>[
|
|
|
+ 'date'=>'ga:dateHour',
|
|
|
+ ],
|
|
|
+ 'day'=>[
|
|
|
+ 'date'=>"ga:date",
|
|
|
+ ],
|
|
|
+ 'week'=>[
|
|
|
+ 'date'=>'ga:yearWeek',
|
|
|
+ ],
|
|
|
+ 'month'=>[
|
|
|
+ 'date'=>'ga:yearMonth'
|
|
|
+ ],
|
|
|
+ ];
|
|
|
+ foreach($times as $k=>$v){
|
|
|
+ $productConfig=[
|
|
|
+ 'dp'=>$store,
|
|
|
+ 'dimensionArr'=>$v,
|
|
|
+ 'metricArr'=>[
|
|
|
+ '销量'=>"ga:itemQuantity",
|
|
|
+ '订单量'=>"ga:transactions",
|
|
|
+ '订单金额'=>"ga:transactionRevenue",
|
|
|
+ ],
|
|
|
+ 'date'=>['start_at'=>$start_day,'end_at'=>$end_day]
|
|
|
+ ];
|
|
|
+ $infoData[$k]=$ga->getData($productConfig);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $skuConfig=[
|
|
|
'dp'=>$store,
|
|
|
'dimensionArr'=>[
|
|
|
'productSku'=>"ga:productSku",
|
|
@@ -337,7 +374,7 @@ class IndexController extends \app\controllers\HomeController
|
|
|
],
|
|
|
'date'=>['start_at'=>$start_day,'end_at'=>$end_day]
|
|
|
];
|
|
|
- $productInfo=$ga->getData($storeConfig);
|
|
|
+ $skuInfo=$ga->getData($skuConfig);
|
|
|
echo "<pre>";
|
|
|
print_r($productInfo);exit;
|
|
|
$this->json(1,$productInfo);
|