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 24c3be4d
authored
Jul 02, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправление, при ошибке добавления или редактирования снятия резервирование записи
1 parent
37ba8d47
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
12 deletions
app/Service/Requests/Direct/AddAdGroups.php
app/Service/Requests/Direct/AddAds.php
app/Service/Requests/Direct/AddBidModifiers.php
app/Service/Requests/Direct/AddCampaigns.php
app/Service/Requests/Direct/AddKeywords.php
app/Service/Requests/Direct/UpdateAdGroups.php
app/Service/Requests/Direct/UpdateAds.php
app/Service/Requests/Direct/UpdateCampaigns.php
app/Service/Requests/Direct/UpdateKeywords.php
app/Service/Requests/Direct/AddAdGroups.php
View file @
24c3be4
...
...
@@ -55,17 +55,23 @@ class AddAdGroups extends DirectRequest
}
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
$goalAdGroup
=
$this
->
goalAdGroups
->
get
(
$key
);
if
(
!
isset
(
$add_result
[
'Id'
]))
{
Log
::
debug
(
"AddAdGroup, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'AdGroups'
][
$key
]);
$goalAdGroup
->
update
([
'reserve_create_at'
=>
null
,
]);
continue
;
}
$external_id
=
(
string
)
$add_result
[
'Id'
];
$goalAdGroup
=
$this
->
goalAdGroups
->
get
(
$key
);
$goalAdGroup
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
...
...
app/Service/Requests/Direct/AddAds.php
View file @
24c3be4
...
...
@@ -56,18 +56,25 @@ class AddAds extends DirectRequest
}
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
/* @var $goalAd GoalAdvertisement|Advertisement|\stdClass */
$goalAd
=
$this
->
goalAds
->
get
(
$key
);
if
(
!
isset
(
$add_result
[
'Id'
]))
{
Log
::
debug
(
"AddAds, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'Ads'
][
$key
]);
GoalAdvertisement
::
whereId
(
$goalAd
->
id
)
->
update
([
'reserve_create_at'
=>
null
,
]);
continue
;
}
$external_id
=
(
string
)
$add_result
[
'Id'
];
/* @var $goalAd GoalAdvertisement|Advertisement|\stdClass */
$goalAd
=
$this
->
goalAds
->
get
(
$key
);
GoalAdvertisement
::
whereId
(
$goalAd
->
id
)
->
update
([
'external_id'
=>
$external_id
,
...
...
app/Service/Requests/Direct/AddBidModifiers.php
View file @
24c3be4
...
...
@@ -55,18 +55,25 @@ class AddBidModifiers extends DirectRequest
}
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
/* @var $goalBidModifier \stdClass */
$goalBidModifier
=
$this
->
goalBidModifiers
->
get
(
$key
);
if
(
!
isset
(
$add_result
[
'Id'
]))
{
Log
::
debug
(
"AddBidModifiers, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'BidModifiers'
][
$key
]);
GoalBidModifier
::
where
(
'id'
,
$goalBidModifier
->
id
)
->
update
([
'reserve_create_at'
=>
null
,
]);
continue
;
}
$external_id
=
(
string
)
$add_result
[
'Id'
];
/* @var $goalBidModifier \stdClass */
$goalBidModifier
=
$this
->
goalBidModifiers
->
get
(
$key
);
GoalBidModifier
::
where
(
'id'
,
$goalBidModifier
->
id
)
->
update
([
'external_id'
=>
$external_id
,
...
...
app/Service/Requests/Direct/AddCampaigns.php
View file @
24c3be4
...
...
@@ -57,17 +57,24 @@ class AddCampaigns extends DirectRequest
}
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
$dictionaryCampaign
=
$this
->
dictionaryCampaigns
->
get
(
$key
);
if
(
!
isset
(
$add_result
[
'Id'
]))
{
Log
::
debug
(
"AddCampaigns, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'Campaigns'
][
$key
]);
$dictionaryCampaign
->
update
([
'reserve_create_at'
=>
null
,
]);
continue
;
}
$external_id
=
(
string
)
$add_result
[
'Id'
];
$dictionaryCampaign
=
$this
->
dictionaryCampaigns
->
get
(
$key
);
$dictionaryCampaign
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
...
...
app/Service/Requests/Direct/AddKeywords.php
View file @
24c3be4
...
...
@@ -56,17 +56,24 @@ class AddKeywords extends DirectRequest
}
foreach
(
$response
[
'result'
][
'AddResults'
]
as
$key
=>
$add_result
)
{
$goalKeyword
=
$this
->
goalKeywords
[
$key
];
if
(
!
isset
(
$add_result
[
'Id'
]))
{
Log
::
debug
(
"AddKeywords, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'Keywords'
][
$key
]);
GoalKeyword
::
whereId
(
$goalKeyword
->
id
)
->
update
([
'reserve_create_at'
=>
null
,
]);
continue
;
}
$external_id
=
(
string
)
$add_result
[
'Id'
];
$goalKeyword
=
$this
->
goalKeywords
[
$key
];
GoalKeyword
::
whereId
(
$goalKeyword
->
id
)
->
update
([
'external_id'
=>
$external_id
,
...
...
app/Service/Requests/Direct/UpdateAdGroups.php
View file @
24c3be4
...
...
@@ -56,6 +56,11 @@ class UpdateAdGroups extends DirectRequest
Log
::
debug
(
"UpdateAdGroup, empty Id"
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$this
->
getParams
()[
'AdGroups'
][
$key
]);
GoalAdGroup
::
whereExternalId
(
$this
->
getParams
()[
'AdGroups'
][
$key
][
'Id'
])
->
update
([
'reserve_update_at'
=>
null
,
]);
}
continue
;
}
...
...
app/Service/Requests/Direct/UpdateAds.php
View file @
24c3be4
...
...
@@ -47,6 +47,12 @@ class UpdateAds extends DirectRequest
Log
::
debug
(
"UpdateAds, empty Id"
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$this
->
getParams
()[
'Ads'
][
$key
]);
GoalAdvertisement
::
whereExternalId
(
$this
->
getParams
()[
'Ads'
][
$key
][
'Id'
])
->
update
([
'reserve_update_at'
=>
null
,
]);
continue
;
}
...
...
app/Service/Requests/Direct/UpdateCampaigns.php
View file @
24c3be4
...
...
@@ -48,6 +48,12 @@ class UpdateCampaigns extends DirectRequest
Log
::
debug
(
"UpdateCampaigns, empty Id"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'Campaigns'
][
$key
]);
DictionaryCampaign
::
whereExternalId
(
$this
->
getParams
()[
'Campaigns'
][
$key
][
'Id'
])
->
update
([
'reserve_update_at'
=>
null
,
]);
continue
;
}
...
...
app/Service/Requests/Direct/UpdateKeywords.php
View file @
24c3be4
...
...
@@ -47,6 +47,12 @@ class UpdateKeywords extends DirectRequest
Log
::
debug
(
"UpdateKeywords, empty Id"
);
Log
::
debug
(
$update_result
);
Log
::
debug
(
$this
->
getParams
()[
'Keywords'
][
$key
]);
GoalKeyword
::
whereExternalId
(
$this
->
getParams
()[
'Keywords'
][
$key
][
'Id'
])
->
update
([
'reserve_update_at'
=>
null
,
]);
continue
;
}
...
...
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