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 4e80940c
authored
Jul 09, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19499 Загрузка модификаторов ставок
1 parent
5688ff64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
app/Console/Commands/BidModifiersAdd.php
app/Service/Requests/Direct/AddBidModifiers.php
app/Console/Commands/BidModifiersAdd.php
View file @
4e80940
...
...
@@ -79,7 +79,9 @@ class BidModifiersAdd extends Command
])
->
get
();
foreach
(
array_chunk
(
$goalBidModifiers
->
pluck
(
'ids'
)
->
collapse
()
->
toArray
(),
1000
)
as
$items
)
{
foreach
(
array_chunk
(
$goalBidModifiers
->
pluck
(
'ids'
)
->
map
(
function
(
$ids
)
{
return
json_decode
(
$ids
);
})
->
collapse
()
->
toArray
(),
1000
)
as
$items
)
{
GoalBidModifier
::
whereIn
(
'id'
,
$items
)
->
update
([
'reserve_create_at'
=>
Carbon
::
now
(),
...
...
app/Service/Requests/Direct/AddBidModifiers.php
View file @
4e80940
...
...
@@ -59,12 +59,14 @@ class AddBidModifiers extends DirectRequest
/* @var $goalBidModifier \stdClass */
$goalBidModifier
=
$this
->
goalBidModifiers
->
get
(
$key
);
$ids
=
json_decode
(
$goalBidModifier
->
ids
);
if
(
!
isset
(
$add_result
[
'Ids'
]))
{
Log
::
debug
(
"AddBidModifiers, empty Ids"
);
Log
::
debug
(
$add_result
);
Log
::
debug
(
$this
->
getParams
()[
'BidModifiers'
][
$key
]);
GoalBidModifier
::
whereIn
(
'id'
,
$
goalBidModifier
->
ids
)
GoalBidModifier
::
whereIn
(
'id'
,
$ids
)
->
update
([
'reserve_create_at'
=>
null
,
]);
...
...
@@ -72,13 +74,11 @@ class AddBidModifiers extends DirectRequest
continue
;
}
$ids
=
json_decode
(
$goalBidModifier
->
ids
);
foreach
(
$add_result
[
'Ids'
]
as
$id_key
=>
$external_id
)
{
$external_id
=
(
string
)
$external_id
;
$id
=
$ids
[
$id_key
];
GoalBidModifier
::
where
In
(
'id'
,
$id
)
GoalBidModifier
::
where
(
'id'
,
$id
)
->
update
([
'external_id'
=>
$external_id
,
'external_upload_at'
=>
Carbon
::
now
(),
...
...
@@ -95,7 +95,9 @@ class AddBidModifiers extends DirectRequest
public
function
failed
()
{
GoalBidModifier
::
whereIn
(
'id'
,
$this
->
goalBidModifiers
->
pluck
(
'ids'
)
->
collapse
()
->
toArray
())
GoalBidModifier
::
whereIn
(
'id'
,
$this
->
goalBidModifiers
->
pluck
(
'ids'
)
->
map
(
function
(
$ids
)
{
return
json_decode
(
$ids
);
})
->
collapse
()
->
toArray
())
->
update
([
'reserve_create_at'
=>
null
,
]);
...
...
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