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 2ee1f011
authored
May 28, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19465 Реализация синхронизации данных по РК.
1 parent
9262aedc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
.env.example
app/Service/Requests/Direct/AddCampaigns.php
app/Service/Requests/DirectRequest.php
config/api.php
.env.example
View file @
2ee1f01
...
...
@@ -6,7 +6,7 @@ APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=
sqlite
DB_CONNECTION=
mysql
BROADCAST_DRIVER=log
CACHE_DRIVER=file
...
...
@@ -40,5 +40,6 @@ PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
YANDEX_ID=
YANDEX_PASSWORD=
YANDEX_ID="ae9bf7257fcd43b1a8d0592e95a3fb79"
YANDEX_PASSWORD="ae9bf7257fcd43b1a8d0592e95a3fb79"
YANDEX_URL="https://api.direct.yandex.com/json/v5/"
app/Service/Requests/Direct/AddCampaigns.php
View file @
2ee1f01
...
...
@@ -79,11 +79,6 @@ class AddCampaigns extends DirectRequest
'BiddingStrategyType'
=>
$dictionaryCampaign
->
campaign
->
text_campaign_strategy_network
,
],
],
'RelevantKeywords'
=>
[
'BudgetPercent'
=>
$dictionaryCampaign
->
campaign
->
relevant_keywords_setting_budget_percent
,
'OptimizeGoalId'
=>
$dictionaryCampaign
->
campaign
->
relevant_keywords_setting_optimize_goal_id
,
],
'AttributionModel'
=>
$dictionaryCampaign
->
campaign
->
attribution_model
,
],
];
...
...
@@ -117,6 +112,17 @@ class AddCampaigns extends DirectRequest
];
}
if
(
$dictionaryCampaign
->
campaign
->
relevant_keywords_setting_budget_percent
)
{
$data
[
'RelevantKeywords'
]
=
[
'BudgetPercent'
=>
$dictionaryCampaign
->
campaign
->
relevant_keywords_setting_budget_percent
,
'OptimizeGoalId'
=>
$dictionaryCampaign
->
campaign
->
relevant_keywords_setting_optimize_goal_id
,
];
}
if
(
$dictionaryCampaign
->
campaign
->
attribution_model
)
{
$data
[
'AttributionModel'
]
=
$dictionaryCampaign
->
campaign
->
attribution_model
;
}
if
(
$dictionaryCampaign
->
campaign
->
settings
&&
count
(
$dictionaryCampaign
->
campaign
->
settings
))
{
$settingsAllow
=
Campaigns
::
getSettingOptionsAllow
();
...
...
app/Service/Requests/DirectRequest.php
View file @
2ee1f01
...
...
@@ -11,7 +11,14 @@ class DirectRequest extends APIRequest {
CONST
MAX_COUNT
=
10000
;
private
$url
=
'https://api.direct.yandex.com/json/v5/'
;
private
$url
;
protected
function
__construct
(
$api
)
{
parent
::
__construct
(
$api
);
$this
->
url
=
config
(
'api.yandex.url'
);
}
function
chunk
(
$count
)
:
?
\App\Service\Contract\APIRequest
{
...
...
config/api.php
View file @
2ee1f01
...
...
@@ -2,7 +2,8 @@
//https://oauth.yandex.ru/client/41fef5d911a54f63b685c8155d189b61
return
[
'yandex'
=>
[
'id'
=>
env
(
'YANDEX_ID'
,
'dc562de5b1fb47e2ba30b88745e90f4a'
),
'url'
=>
env
(
'YANDEX_URL'
,
'https://api-sandbox.direct.yandex.com/json/v5/'
),
'id'
=>
env
(
'YANDEX_ID'
,
'dc562de5b1fb47e2ba30b88745e90f4a'
),
'password'
=>
env
(
'YANDEX_PASSWORD'
,
'6583c9e98dca4e0abf7024578584deeb'
)
]
];
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