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 0edc209e
authored
Dec 30, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Исправление ошибку при удалении, выставление флага на архивирование
1 parent
d048b0ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
app/Models/Pivots/GoalAdvertisement.php
app/Service/Requests/Direct/DeleteAds.php
app/Models/Pivots/GoalAdvertisement.php
View file @
0edc209
...
...
@@ -240,7 +240,9 @@ class GoalAdvertisement extends Pivot
->
whereColumn
(
'goal_advertisements.goal_ad_group_id'
,
'goal_ad_groups.id'
);
});
});
})
->
whereNull
(
'goal_advertisements.deleted_at'
);
})
->
whereNull
(
'goal_advertisements.deleted_at'
)
->
whereNull
(
'goal_advertisements.archive_at'
)
->
whereNull
(
'goal_advertisements.archived_need'
);
}
/**
...
...
app/Service/Requests/Direct/DeleteAds.php
View file @
0edc209
...
...
@@ -8,6 +8,7 @@ use App\Models\Pivots\GoalAdvertisement;
use
App\Service\Contract\APIRequest
;
use
App\Service\DirectResponseHelper
;
use
App\Service\Requests\DirectRequest
;
use
Carbon\Carbon
;
use
Illuminate\Support\Facades\Log
;
class
DeleteAds
extends
DirectRequest
...
...
@@ -73,7 +74,27 @@ class DeleteAds extends DirectRequest
continue
;
}
elseif
(
isset
(
$delete_result
[
'Errors'
])
&&
count
(
$delete_result
[
'Errors'
]))
{
}
elseif
(
isset
(
$delete_result
[
'Errors'
][
0
][
'Code'
])
&&
$delete_result
[
'Errors'
][
0
][
'Code'
]
==
8300
)
{
if
(
$this
->
getToken
()
->
isMain
())
{
Advertisement
::
where
(
'external_id'
,
$external_id
)
->
update
([
'archived_need'
=>
Carbon
::
now
()
]);
}
else
{
GoalAdvertisement
::
where
(
'external_id'
,
$external_id
)
->
update
([
'archived_need'
=>
Carbon
::
now
()
]);
}
continue
;
}
elseif
(
isset
(
$delete_result
[
'Errors'
])
&&
count
(
$delete_result
[
'Errors'
]))
{
$goalAd
=
GoalAdvertisement
::
whereExternalId
(
$external_id
)
->
first
();
if
(
$goalAd
)
{
...
...
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