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 1359384c
authored
May 25, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19465 Реализация синхронизации данных по РК.
1 parent
2676cf9f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
app/Console/Commands/CampaignsUpdate.php
app/Service/Requests/Direct/AddCampaigns.php
app/Service/Requests/Direct/UpdateCampaigns.php
app/Console/Commands/CampaignsUpdate.php
View file @
1359384
...
@@ -49,7 +49,7 @@ class CampaignsUpdate extends Command
...
@@ -49,7 +49,7 @@ class CampaignsUpdate extends Command
},
},
'dictionaryCampaignsForExternalNeedUpdated.campaign'
'dictionaryCampaignsForExternalNeedUpdated.campaign'
])
->
where
(
'type'
,
'!='
,
Tokens
::
MAIN
)
])
->
where
(
'type'
,
'!='
,
Tokens
::
MAIN
)
->
firs
t
();
->
ge
t
();
foreach
(
$tokens
as
$token
)
{
foreach
(
$tokens
as
$token
)
{
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
$factory
=
APIRequest
::
getInstance
(
API
::
YANDEX
);
...
...
app/Service/Requests/Direct/AddCampaigns.php
View file @
1359384
...
@@ -30,7 +30,6 @@ class AddCampaigns extends DirectRequest
...
@@ -30,7 +30,6 @@ class AddCampaigns extends DirectRequest
public
function
handle
(
$response
)
public
function
handle
(
$response
)
{
{
try
{
try
{
Log
::
debug
(
$response
);
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
$id
=
$add_result
[
'Id'
]
??
''
;
$id
=
$add_result
[
'Id'
]
??
''
;
...
...
app/Service/Requests/Direct/UpdateCampaigns.php
View file @
1359384
...
@@ -30,6 +30,7 @@ class UpdateCampaigns extends DirectRequest
...
@@ -30,6 +30,7 @@ class UpdateCampaigns extends DirectRequest
public
function
handle
(
$response
)
public
function
handle
(
$response
)
{
{
try
{
try
{
Log
::
debug
(
$response
);
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$add_result
)
{
foreach
(
$response
[
'result'
][
'UpdateResults'
]
as
$key
=>
$add_result
)
{
$id
=
$add_result
[
'Id'
]
??
''
;
$id
=
$add_result
[
'Id'
]
??
''
;
...
@@ -69,6 +70,7 @@ class UpdateCampaigns extends DirectRequest
...
@@ -69,6 +70,7 @@ class UpdateCampaigns extends DirectRequest
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$dictionaryCampaign
);
$list
=
Variable
::
getListVariablesByDictionaryCampaign
(
$dictionaryCampaign
);
$data
=
[
$data
=
[
'Id'
=>
$dictionaryCampaign
->
external_id
,
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$dictionaryCampaign
->
name
,
$list
)
->
get
(),
'Name'
=>
StrReplaceByVariables
::
getInstance
(
$dictionaryCampaign
->
name
,
$list
)
->
get
(),
'StartDate'
=>
Carbon
::
now
()
->
format
(
'Y-m-d'
),
'StartDate'
=>
Carbon
::
now
()
->
format
(
'Y-m-d'
),
'TextCampaign'
=>
[
'TextCampaign'
=>
[
...
...
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