Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
monero-project
CCS Backend
Commits
c926ad45
Commit
c926ad45
authored
Dec 30, 2018
by
beardedwarrior
Browse files
updated the process proposals to pull the latest information from the front matter
parent
a042be90
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Console/Commands/ProcessProposals.php
View file @
c926ad45
...
...
@@ -2,6 +2,7 @@
namespace
App\Console\Commands
;
use
App\Project
;
use
Illuminate\Console\Command
;
use
Illuminate\Support\Facades\Storage
;
...
...
@@ -36,20 +37,30 @@ class ProcessProposals extends Command
*/
public
function
handle
()
{
$amounts
=
[];
$projects
=
Project
::
whereNull
(
'filename'
);
$details
=
[];
$files
=
Storage
::
files
(
'ffs-proposals'
);
foreach
(
$files
as
$file
)
{
if
(
strpos
(
$file
,
'.md'
))
{
$amount
[
'name'
]
=
$file
;
$amount
[
'values'
]
=
$this
->
getAmountFromText
(
$file
);
$amounts
[]
=
$amount
;
$detail
[
'name'
]
=
$file
;
$detail
[
'values'
]
=
$this
->
getAmountFromText
(
$file
);
$details
[]
=
$detail
[
'values'
][
'title'
];
$project
=
$projects
->
where
(
'title'
,
$detail
[
'values'
][
'title'
])
->
first
();
if
(
$project
)
{
$project
->
filename
=
$file
;
$project
->
target_amount
=
$detail
[
'values'
][
'amount'
];
$project
->
save
();
}
}
}
dd
(
$amounts
);
foreach
(
$details
as
$det
)
{
$this
->
line
(
$det
);
}
}
/**
* Gets the ffs
am
ou
n
t
requested from a
file
* Gets the ffs
variables
out
the top of the
file
*
* @param string $filename
* @return array
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
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 comment