Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
workbiu-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gxx
workbiu-admin
Commits
b1716724
Commit
b1716724
authored
Dec 12, 2017
by
gxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了bug
parent
ea4a18d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
FileController.php
app/Http/Controllers/FileController.php
+1
-1
FileService.php
app/Services/FileService.php
+5
-2
groupinformation.blade.php
resources/views/admin/group/groupinformation.blade.php
+2
-1
web.php
routes/web.php
+1
-1
No files found.
app/Http/Controllers/FileController.php
View file @
b1716724
...
...
@@ -35,7 +35,7 @@ class FileController extends Controller
{
$group_id
=
$request
->
group_id
;
$result
=
$this
->
mFile
->
groupSpace
(
$group_id
);
$mbyte
=
$result
/
1048576
;
$mbyte
=
ceil
(
$result
/
1048576
)
;
$finalspace
=
array
(
"usespace"
=>
$mbyte
);
$finalspace
=
json_encode
(
$finalspace
);
return
$finalspace
;
...
...
app/Services/FileService.php
View file @
b1716724
...
...
@@ -62,7 +62,10 @@ class FileService implements FileServiceContract
public
function
groupSpace
(
$group_id
)
{
$files
=
File
::
where
([
"group"
=>
$group_id
])
->
get
();
$files
=
File
::
where
([
"group_id"
=>
$group_id
])
->
get
();
if
(
$files
->
isEmpty
()){
return
null
;
}
$space
=
0
;
foreach
(
$files
as
$file
)
{
...
...
@@ -74,7 +77,7 @@ class FileService implements FileServiceContract
public
function
ossSpace
(
$group_id
)
{
$files
=
File
::
where
([
"group"
=>
$group_id
])
->
get
()
->
unique
(
"pointer"
);
$files
=
File
::
where
([
"group
_id
"
=>
$group_id
])
->
get
()
->
unique
(
"pointer"
);
$space
=
0
;
foreach
(
$files
as
$file
)
{
...
...
resources/views/admin/group/groupinformation.blade.php
View file @
b1716724
...
...
@@ -133,6 +133,7 @@
<
div
class
=
"tab-pane"
id
=
"settings"
>
<
div
id
=
"main"
style
=
"width: 600px;height:400px;"
></
div
>
<
input
type
=
"text"
value
=
""
>
</
div
>
<!--
/.
tab
-
pane
-->
...
...
@@ -165,7 +166,7 @@
type
:
'get'
,
url
:
'{{route('
file
.
groupSpace
')}}'
,
success
:
function
(
data
){
//
console.log(data);
console
.
log
(
data
);
if
(
data
==
''
){
alert
(
111
);
...
...
routes/web.php
View file @
b1716724
...
...
@@ -115,7 +115,7 @@ Route::get('/',function (){return view('login');})->name('admin.login');
Route
::
group
([
'prefix'
=>
'file'
],
function
(){
Route
::
get
(
'get_all'
,
'FileController@getAll'
)
->
name
(
'file.getAll'
);
Route
::
delete
(
'delete_file'
,
'FileController@delete'
)
->
name
(
'file.delete'
);
Route
::
get
(
'group_space'
,
'FileController@groupSpace'
)
->
name
(
'file.group
s
pace'
);
Route
::
get
(
'group_space'
,
'FileController@groupSpace'
)
->
name
(
'file.group
S
pace'
);
Route
::
get
(
'oss_space'
,
'FileController@ossSpace'
)
->
name
(
'file.ossspace'
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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