Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Письменов Дмитрий Иванович
/
yourroomads
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4463a059
authored
Jun 21, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправление усечение get запроса
1 parent
f6a5488f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
23 deletions
app/Console/Commands/AdGroupsLoadKeywords.php
app/Console/Commands/AdGroupsLoadUpdated.php
app/Service/Requests/Direct/GetAdGroups.php
app/Service/Requests/Direct/GetKeywords.php
app/Console/Commands/AdGroupsLoadKeywords.php
View file @
4463a05
...
@@ -60,13 +60,15 @@ class AdGroupsLoadKeywords extends Command
...
@@ -60,13 +60,15 @@ class AdGroupsLoadKeywords extends Command
->
pluck
(
'external_id'
)
->
pluck
(
'external_id'
)
->
toArray
();
->
toArray
();
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
foreach
(
array_chunk
(
$ad_group_ids
,
1000
)
as
$ids_limit
)
{
$factory
->
setToken
(
$token
);
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'Keywords'
,
'get'
)
$factory
->
getRequest
(
'Keywords'
,
'get'
)
->
call
([
->
call
([
'AdGroupIds'
=>
$ad_group_ids
,
'AdGroupIds'
=>
$ids_limit
,
]);
]);
}
return
0
;
return
0
;
}
}
...
...
app/Console/Commands/AdGroupsLoadUpdated.php
View file @
4463a05
...
@@ -66,12 +66,14 @@ class AdGroupsLoadUpdated extends Command
...
@@ -66,12 +66,14 @@ class AdGroupsLoadUpdated extends Command
'Ids'
=>
$ids
,
'Ids'
=>
$ids
,
]);
]);
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
foreach
(
array_chunk
(
$ids
,
1000
)
as
$ids_limit
)
{
$factory
->
setToken
(
$token
);
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
->
setToken
(
$token
);
$factory
->
getRequest
(
'Keywords'
,
'get'
)
->
call
([
$factory
->
getRequest
(
'Keywords'
,
'get'
)
->
call
([
'AdGroupIds'
=>
$ids
,
'AdGroupIds'
=>
$ids_limit
,
]);
]);
}
}
}
...
...
app/Service/Requests/Direct/GetAdGroups.php
View file @
4463a05
...
@@ -29,7 +29,7 @@ class GetAdGroups extends DirectRequest
...
@@ -29,7 +29,7 @@ class GetAdGroups extends DirectRequest
{
{
$params
=
$this
->
getParams
();
$params
=
$this
->
getParams
();
if
(
isset
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
]))
{
return
count
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
])
;
return
-
1
;
}
}
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
return
count
(
$params
[
'SelectionCriteria'
][
'Ids'
]);
return
count
(
$params
[
'SelectionCriteria'
][
'Ids'
]);
...
@@ -41,9 +41,6 @@ class GetAdGroups extends DirectRequest
...
@@ -41,9 +41,6 @@ class GetAdGroups extends DirectRequest
{
{
$params
=
$this
->
getParams
();
$params
=
$this
->
getParams
();
if
(
isset
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
]))
{
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'CampaignIds'
]);
}
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'Ids'
]);
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'Ids'
]);
}
}
...
...
app/Service/Requests/Direct/GetKeywords.php
View file @
4463a05
...
@@ -31,10 +31,10 @@ class GetKeywords extends DirectRequest
...
@@ -31,10 +31,10 @@ class GetKeywords extends DirectRequest
{
{
$params
=
$this
->
getParams
();
$params
=
$this
->
getParams
();
if
(
isset
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
]))
{
return
count
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
])
;
return
-
1
;
}
}
if
(
isset
(
$params
[
'SelectionCriteria'
][
'AdGroupIds'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'AdGroupIds'
]))
{
return
count
(
$params
[
'SelectionCriteria'
][
'AdGroupIds'
])
;
return
-
1
;
}
}
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
return
count
(
$params
[
'SelectionCriteria'
][
'Ids'
]);
return
count
(
$params
[
'SelectionCriteria'
][
'Ids'
]);
...
@@ -46,12 +46,6 @@ class GetKeywords extends DirectRequest
...
@@ -46,12 +46,6 @@ class GetKeywords extends DirectRequest
{
{
$params
=
$this
->
getParams
();
$params
=
$this
->
getParams
();
if
(
isset
(
$params
[
'SelectionCriteria'
][
'CampaignIds'
]))
{
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'CampaignIds'
]);
}
if
(
isset
(
$params
[
'SelectionCriteria'
][
'AdGroupIds'
]))
{
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'AdGroupIds'
]);
}
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
if
(
isset
(
$params
[
'SelectionCriteria'
][
'Ids'
]))
{
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'Ids'
]);
return
$this
->
sliceByKey
(
$maxObjects
,
[
'SelectionCriteria'
,
'Ids'
]);
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment