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