report调用广告分析数据聚合接口 更新4
This commit is contained in:
parent
d99f342881
commit
9a60e35749
@ -103,7 +103,7 @@ class BpsAdController
|
||||
$parts = explode('#', $metric);
|
||||
if (count($parts) !== 4) continue;
|
||||
|
||||
[$sourceType, $platform, $field] = $parts;
|
||||
[$sourceType, $platform, $field, $format] = $parts;
|
||||
$sourceType = strtolower($sourceType);
|
||||
$platformKey = strtolower($platform);
|
||||
|
||||
@ -158,11 +158,12 @@ class BpsAdController
|
||||
{
|
||||
$options = $request->all();
|
||||
$options['jwtClaims'] = $request->jwtClaims;
|
||||
$options['rpc'] = $request->rpc ?? false;
|
||||
$options['rpc'] = (bool)true;
|
||||
if ($options['rpc']) {
|
||||
//$options['conditions']['startDate']由2025-02-14处理成纯整数
|
||||
$options['conditions']['startDate'] = (int)str_replace('-', '', $options['conditions']['startDate']);
|
||||
$options['conditions']['endDate'] = (int)str_replace('-', '', $options['conditions']['endDate']);
|
||||
$options['jwtClaims'] = $options['conditions']['user'];
|
||||
}
|
||||
|
||||
|
||||
@ -181,6 +182,9 @@ class BpsAdController
|
||||
$accounts = $this->bpsAdAccountService->getAllAdAccounts(['merchant_id' => $options['jwtClaims']['merchant_id'], 'platform' => $platformType]);
|
||||
|
||||
if (empty($accounts)) {
|
||||
if ($options['rpc']) {
|
||||
return [];
|
||||
}
|
||||
return $this->successResponse(['data' => []], $request);
|
||||
}
|
||||
// dump($accounts);
|
||||
@ -219,6 +223,7 @@ class BpsAdController
|
||||
//$options['conditions']['startDate']由2025-02-14处理成纯整数
|
||||
$options['conditions']['startDate'] = (int)str_replace('-', '', $options['conditions']['startDate']);
|
||||
$options['conditions']['endDate'] = (int)str_replace('-', '', $options['conditions']['endDate']);
|
||||
$options['jwtClaims'] = $options['conditions']['user'];
|
||||
}
|
||||
|
||||
// 获取请求参数
|
||||
@ -236,6 +241,9 @@ class BpsAdController
|
||||
$accounts = $this->bpsAdAccountService->getAllAdAccounts(['merchant_id' => $options['jwtClaims']['merchant_id'], 'platform' => $platformType]);
|
||||
|
||||
if (empty($accounts)) {
|
||||
if ($options['rpc']) {
|
||||
return [];
|
||||
}
|
||||
return $this->successResponse(['data' => []], $request);
|
||||
}
|
||||
|
||||
@ -267,11 +275,12 @@ class BpsAdController
|
||||
{
|
||||
$options = $request->all();
|
||||
$options['jwtClaims'] = $request->jwtClaims;
|
||||
$options['rpc'] = $request->rpc ?? false;
|
||||
$options['rpc'] = (bool)true;
|
||||
if ($options['rpc']) {
|
||||
//$options['conditions']['startDate']由2025-02-14处理成纯整数
|
||||
$options['conditions']['startDate'] = (int)str_replace('-', '', $options['conditions']['startDate']);
|
||||
$options['conditions']['endDate'] = (int)str_replace('-', '', $options['conditions']['endDate']);
|
||||
$options['jwtClaims'] = $options['conditions']['user'];
|
||||
}
|
||||
|
||||
// 获取请求参数
|
||||
@ -288,6 +297,9 @@ class BpsAdController
|
||||
$accounts = $this->bpsAdAccountService->getAllAdAccounts(['merchant_id' => $options['jwtClaims']['merchant_id'], 'platform' => $platformType]);
|
||||
|
||||
if (empty($accounts)) {
|
||||
if ($options['rpc']) {
|
||||
return [];
|
||||
}
|
||||
return $this->successResponse(['data' => []], $request);
|
||||
}
|
||||
|
||||
@ -540,6 +552,7 @@ class BpsAdController
|
||||
//$options['conditions']['startDate']由2025-02-14处理成纯整数
|
||||
$options['conditions']['startDate'] = (int)str_replace('-', '', $options['conditions']['startDate']);
|
||||
$options['conditions']['endDate'] = (int)str_replace('-', '', $options['conditions']['endDate']);
|
||||
$options['jwtClaims'] = $options['conditions']['user'];
|
||||
}
|
||||
|
||||
// 获取请求参数
|
||||
@ -557,6 +570,9 @@ class BpsAdController
|
||||
$accounts = $this->bpsAdAccountService->getAllAdAccounts(['merchant_id' => $options['jwtClaims']['merchant_id'], 'platform' => $platformType]);
|
||||
|
||||
if (empty($accounts)) {
|
||||
if ($options['rpc']) {
|
||||
return [];
|
||||
}
|
||||
return $this->successResponse(['data' => []], $request);
|
||||
}
|
||||
|
||||
@ -592,6 +608,7 @@ class BpsAdController
|
||||
//$options['conditions']['startDate']由2025-02-14处理成纯整数
|
||||
$options['conditions']['startDate'] = (int)str_replace('-', '', $options['conditions']['startDate']);
|
||||
$options['conditions']['endDate'] = (int)str_replace('-', '', $options['conditions']['endDate']);
|
||||
$options['jwtClaims'] = $options['conditions']['user'];
|
||||
}
|
||||
|
||||
// 获取请求参数
|
||||
@ -609,6 +626,9 @@ class BpsAdController
|
||||
$accounts = $this->bpsAdAccountService->getAllAdAccounts(['merchant_id' => $options['jwtClaims']['merchant_id'], 'platform' => $platformType]);
|
||||
|
||||
if (empty($accounts)) {
|
||||
if ($options['rpc']) {
|
||||
return [];
|
||||
}
|
||||
return $this->successResponse(['data' => []], $request);
|
||||
}
|
||||
|
||||
@ -713,6 +733,9 @@ class BpsAdController
|
||||
$options = $request->all();
|
||||
$options['jwtClaims'] = $request->jwtClaims;
|
||||
$options['rpc'] = $request->rpc ?? false;
|
||||
if ($options['rpc']) {
|
||||
$options['jwtClaims'] = $options['conditions']['user'];
|
||||
}
|
||||
|
||||
// 获取请求参数
|
||||
$cycle = $options['conditions']['dateType'] ?? 'today'; //默认today || today yesterday、month、year 、custom
|
||||
|
@ -106,9 +106,7 @@ Route::group('/marketing', function () {
|
||||
]);
|
||||
Route::group('/notice', function () {
|
||||
Route::post('/aggregate', [BpsAdController::class, 'aggregateAd']);
|
||||
})->middleware([
|
||||
app\middleware\JwtLocal::class,
|
||||
]);
|
||||
});
|
||||
Route::group('/customer', function () {
|
||||
Route::get('/handle_binding', [CustomerController::class, 'handleBindingNew']); //绑定接口
|
||||
Route::post('/bind', [CustomerController::class, 'bind']); //绑定接口
|
||||
|
Loading…
Reference in New Issue
Block a user