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 d001fdbc
authored
May 13, 2021
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#19459 Вывод для основного аккаунта списка его РК из кеша
1 parent
0f2d6b16
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
app/Http/Controllers/TokensController.php
app/Models/Campaigns.php
app/Models/Tokens.php
resources/js/Pages/Tokens/Edit.vue
app/Http/Controllers/TokensController.php
View file @
d001fdb
...
...
@@ -40,8 +40,8 @@ class TokensController extends Controller
'token'
=>
$token
->
token
,
'type'
=>
$token
->
type
,
'campaigns'
=>
(
$token
->
type
==
Tokens
::
MAIN
?
$token
->
campaigns
$token
->
type
===
Tokens
::
MAIN
?
$token
->
campaigns
ForManaged
:
null
),
'cities'
=>
(
$token
->
type
==
Tokens
::
GOAL
?
[]
:
null
),
...
...
app/Models/Campaigns.php
View file @
d001fdb
...
...
@@ -28,8 +28,18 @@ class Campaigns extends Model
'updated'
];
protected
$casts
=
[
'manage'
=>
'boolean'
,
'enabled'
=>
'boolean'
,
];
public
function
scopeForUpdated
(
$query
)
{
$query
->
whereNotNull
(
'updated'
);
}
public
function
scopeForManaged
(
$query
)
{
$query
->
where
(
'manage'
,
true
);
}
}
app/Models/Tokens.php
View file @
d001fdb
...
...
@@ -32,4 +32,9 @@ class Tokens extends Model
{
return
$this
->
hasMany
(
Campaigns
::
class
,
'token'
,
'id'
)
->
orderBy
(
'updated_at'
,
'DESC'
);
}
public
function
campaignsForManaged
()
{
return
$this
->
campaigns
()
->
forManaged
();
}
}
resources/js/Pages/Tokens/Edit.vue
View file @
d001fdb
...
...
@@ -50,7 +50,7 @@
{{
campaign
.
name
}}
</td>
<td
class=
"border-t py-3"
>
<input
:id=
"'campaign-enabled-' + campaign.id"
type=
"checkbox"
>
<input
:id=
"'campaign-enabled-' + campaign.id"
:checked=
"campaign.enabled"
type=
"checkbox"
>
<label
:for=
"'campaign-enabled-' + campaign.id"
>
Enabled
</label>
<button
class=
"text-red-600 hover:underline"
tabindex=
"-1"
...
...
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