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 42787f19
authored
Jul 13, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#20414 Загрузка и синхронизация VCards
1 parent
c1ebf045
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
0 deletions
app/Models/Pivots/GoalAdvertisement.php
app/Models/Pivots/GoalSitelink.php
app/Models/Pivots/GoalVCard.php
app/Service/Requests/Direct/AddSitelinks.php
app/Service/Requests/Direct/AddVCards.php
app/Models/Pivots/GoalAdvertisement.php
View file @
42787f1
...
...
@@ -56,9 +56,11 @@ class GoalAdvertisement extends Pivot
protected
$fillable
=
[
'external_id'
,
'goal_v_card_external_id'
,
'goal_sitelink_external_id'
,
'goal_ad_group_external_id'
,
'dictionary_campaign_external_id'
,
'goal_v_card_id'
,
'goal_sitelink_id'
,
'goal_ad_group_id'
,
'dictionary_campaign_id'
,
'advertisement_id'
,
...
...
@@ -85,9 +87,11 @@ class GoalAdvertisement extends Pivot
'id'
,
'external_id'
,
'goal_v_card_external_id'
,
'goal_sitelink_external_id'
,
'goal_ad_group_external_id'
,
'dictionary_campaign_external_id'
,
'goal_v_card_id'
,
'goal_sitelink_id'
,
'goal_ad_group_id'
,
'dictionary_campaign_id'
,
'advertisement_id'
,
...
...
app/Models/Pivots/GoalSitelink.php
View file @
42787f1
...
...
@@ -99,4 +99,9 @@ class GoalSitelink extends Pivot
return
$this
->
belongsTo
(
Sitelink
::
class
,
'sitelink_id'
);
}
public
function
goalAdvertisements
()
{
return
$this
->
hasMany
(
GoalAdvertisement
::
class
,
'goal_sitelink_id'
);
}
}
app/Models/Pivots/GoalVCard.php
View file @
42787f1
...
...
@@ -108,4 +108,9 @@ class GoalVCard extends Pivot
return
$this
->
belongsTo
(
DictionaryCampaign
::
class
,
'dictionary_campaign_id'
);
}
public
function
goalAdvertisements
()
{
return
$this
->
hasMany
(
GoalAdvertisement
::
class
,
'goal_v_card_id'
);
}
}
app/Service/Requests/Direct/AddSitelinks.php
View file @
42787f1
...
...
@@ -78,6 +78,10 @@ class AddSitelinks extends DirectRequest
'reserve_create_at'
=>
null
,
]);
$goalSitelink
->
goalAdvertisements
()
->
update
([
'goal_sitelink_external_id'
=>
$external_id
,
]);
}
}
catch
(
\Exception
$e
)
{
Log
::
debug
(
$e
);
...
...
app/Service/Requests/Direct/AddVCards.php
View file @
42787f1
...
...
@@ -80,6 +80,10 @@ class AddVCards extends DirectRequest
'reserve_create_at'
=>
null
,
]);
$goalVCard
->
goalAdvertisements
()
->
update
([
'goal_v_card_external_id'
=>
$external_id
,
]);
}
}
catch
(
\Exception
$e
)
{
Log
::
debug
(
$e
);
...
...
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